This commit is contained in:
parent
e60de419e0
commit
666a08c46e
3 changed files with 40 additions and 31 deletions
|
|
@ -24,6 +24,15 @@ let bad_request ?hint req =
|
|||
let body = mk_error_content ?hint `Bad_request in
|
||||
respond_json req body `Bad_request
|
||||
|
||||
let unsupported_media_type req =
|
||||
Logs.err (fun m -> m "unsupported media type");
|
||||
let open Vif.Response in
|
||||
let open Syntax in
|
||||
let* () = add ~field:"accept" Headers.accept_header_value in
|
||||
let* () = add ~field:"avail-languages" Headers.avail_languages_header_value in
|
||||
let body = mk_error_content `Unsupported_media_type in
|
||||
respond_json req body `Unsupported_media_type
|
||||
|
||||
let ok content req =
|
||||
Logs.debug (fun m -> m "ok");
|
||||
respond_json req content `OK
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue