diff options
| author | Adelyn Breedlove <[email protected]> | 2019-02-17 21:18:18 -0700 |
|---|---|---|
| committer | Adelyn Breedlove <[email protected]> | 2019-02-17 21:18:18 -0700 |
| commit | 52c6918c139232ebc4239c156bbf76e00a197530 (patch) | |
| tree | d6a4229e6c747830b89244de97c264c6be172b29 /lib/http/http.ml | |
| parent | Add role test command (diff) | |
| download | disml-52c6918c139232ebc4239c156bbf76e00a197530.tar.xz disml-52c6918c139232ebc4239c156bbf76e00a197530.zip | |
Fix an issue where routes that don't return rate limit info lock forever
Diffstat (limited to 'lib/http/http.ml')
| -rw-r--r-- | lib/http/http.ml | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/http/http.ml b/lib/http/http.ml index 5288aac..ced2810 100644 --- a/lib/http/http.ml +++ b/lib/http/http.ml @@ -27,10 +27,10 @@ module Base = struct ]
let process_response path ((resp:Response.t), body) =
- (match Response.headers resp
- |> Rl.rl_of_header with
- | Some r -> Mvar.put (Rl.find_exn !rl path) r
- | None -> return ())
+ let limit = match Response.headers resp |> Rl.rl_of_header with
+ | Some r -> r
+ | None -> Rl.default
+ in Mvar.put (Rl.find_exn !rl path) limit
>>= fun () ->
match resp |> Response.status |> Code.code_of_status with
| 204 -> Deferred.Or_error.return `Null
|