diff options
author | Ian Price <ianprice90@googlemail.com> | 2013-08-19 03:43:48 +0100 |
---|---|---|
committer | Ian Price <ianprice90@googlemail.com> | 2013-08-19 10:43:02 +0100 |
commit | 20d28792b3781e2ca4fd31f4978fc7a0adfbab9a (patch) | |
tree | 065efb76a138df96aeb902104c4ec57ea34006c5 /module/web | |
parent | 088cfb7d761b01a2620d78f10e8dbcaa07485a32 (diff) | |
download | guile-20d28792b3781e2ca4fd31f4978fc7a0adfbab9a.tar.gz |
`write-request-line' always prints a path component.
* module/web/http.scm (write-request-line): Always write "/" when path
is empty, regardless of query.
* test-suite/tests/web-http.test ("write-request-line"): Add test.
Diffstat (limited to 'module/web')
-rw-r--r-- | module/web/http.scm | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/module/web/http.scm b/module/web/http.scm index 21d2964b4..af04259cc 100644 --- a/module/web/http.scm +++ b/module/web/http.scm @@ -1137,16 +1137,13 @@ three values: the method, the URI, and the version." (display host-port port))))) (let ((path (uri-path uri)) (query (uri-query uri))) - (if (not (string-null? path)) + (if (string-null? path) + (display "/" port) (display path port)) (if query (begin (display "?" port) - (display query port))) - (if (and (string-null? path) - (not query)) - ;; Make sure we display something. - (display "/" port))) + (display query port)))) (display #\space port) (write-http-version version port) (display "\r\n" port)) |