better if-not-match
This commit is contained in:
parent
387484d1c2
commit
b5375b5634
7 changed files with 107 additions and 106 deletions
|
|
@ -189,6 +189,15 @@ let ed25519 s =
|
|||
|> Result.map_error (fun e -> Fmt.str "%a" Mirage_crypto_ec.pp_error e)
|
||||
|> unwrap
|
||||
|
||||
let etag s =
|
||||
match Headers_lib.Etag.parse s with
|
||||
| Ok etag -> etag
|
||||
| Error e -> (
|
||||
(* retry with quotes if needed *)
|
||||
match Headers_lib.Etag.parse (Fmt.str "\"%s\"" s) with
|
||||
| Ok etag -> etag
|
||||
| Error _ -> fail "could not parse etag `%s`: %s" s e)
|
||||
|
||||
(* TODO
|
||||
move to another module
|
||||
can we type the json as a Int_map directly? *)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue