From 3405231a1f865ee41070d7542d445777b0cae761 Mon Sep 17 00:00:00 2001 From: Vincent Botbol Date: Tue, 9 Oct 2018 17:46:20 +0200 Subject: [PATCH] Resto: decode uri before converting the path --- vendors/ocplib-resto/lib_resto-cohttp/server.ml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vendors/ocplib-resto/lib_resto-cohttp/server.ml b/vendors/ocplib-resto/lib_resto-cohttp/server.ml index 6f00e92fa..be129e0a4 100644 --- a/vendors/ocplib-resto/lib_resto-cohttp/server.ml +++ b/vendors/ocplib-resto/lib_resto-cohttp/server.ml @@ -89,9 +89,10 @@ module Make (Encoding : Resto.ENCODING)(Log : LOGGING) = struct let callback server (_io, con) req body = (* FIXME: check inbound adress *) let uri = Request.uri req in + let path = Uri.pct_decode (Uri.path uri) in lwt_log_info "(%s) receive request to %s" - (Connection.to_string con) (Uri.path uri) >>= fun () -> - let path = Utils.split_path (Uri.path uri) in + (Connection.to_string con) path >>= fun () -> + let path = Utils.split_path path in let req_headers = Request.headers req in begin match Request.meth req with