summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--module/web/http.scm13
1 files changed, 12 insertions, 1 deletions
diff --git a/module/web/http.scm b/module/web/http.scm
index 1d52b9d42..aa099feaa 100644
--- a/module/web/http.scm
+++ b/module/web/http.scm
@@ -1079,7 +1079,18 @@ three values: the method, the URI, and the version."
"Write the first line of an HTTP request to @var{port}."
(display method port)
(display #\space port)
- (write-uri uri port)
+ (let ((path (uri-path uri))
+ (query (uri-query uri)))
+ (if (not (string-null? path))
+ (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 #\space port)
(write-http-version version port)
(display "\r\n" port))