From 7bae4075581830e5b212eb1306bcff05a3bb650e Mon Sep 17 00:00:00 2001 From: Eitaro Fukamachi Date: Wed, 19 Sep 2018 23:16:38 +0900 Subject: [PATCH] Decode URI in generate-env. --- src/test.lisp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/test.lisp b/src/test.lisp index 2cb11da..e766dc8 100644 --- a/src/test.lisp +++ b/src/test.lisp @@ -20,10 +20,8 @@ Argument `uri' can be just a path or a full url with scheme and optional port." (let* ((uri (quri:uri uri)) - (path-with-params (quri:copy-uri uri - :host nil - :port nil - :scheme nil)) + (path (quri:url-decode (quri:uri-path uri) :lenient t)) + (query (quri:uri-query uri)) (host (or (quri:uri-host uri) "localhost")) (port (or (quri:uri-port uri) @@ -62,10 +60,12 @@ (list :request-method method ;; Seems that all Clack handlers put into this field ;; only pathname with GET parameters - :request-uri (quri:render-uri path-with-params) + :request-uri (format nil "~A~@[?~A~]" + (or path "/") + query) :script-name "" - :path-info (quri:uri-path uri) - :query-string (or (quri:uri-query uri) "") + :path-info path + :query-string query :server-name host :server-port port :server-protocol :http/1.1