Resto: decode uri before converting the path

This commit is contained in:
Vincent Botbol 2018-10-09 17:46:20 +02:00
parent 57fa653c5e
commit 3405231a1f
No known key found for this signature in database
GPG Key ID: A2CE1BDBED95DA38

View File

@ -89,9 +89,10 @@ module Make (Encoding : Resto.ENCODING)(Log : LOGGING) = struct
let callback server (_io, con) req body = let callback server (_io, con) req body =
(* FIXME: check inbound adress *) (* FIXME: check inbound adress *)
let uri = Request.uri req in let uri = Request.uri req in
let path = Uri.pct_decode (Uri.path uri) in
lwt_log_info "(%s) receive request to %s" lwt_log_info "(%s) receive request to %s"
(Connection.to_string con) (Uri.path uri) >>= fun () -> (Connection.to_string con) path >>= fun () ->
let path = Utils.split_path (Uri.path uri) in let path = Utils.split_path path in
let req_headers = Request.headers req in let req_headers = Request.headers req in
begin begin
match Request.meth req with match Request.meth req with