1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-10 22:10:21 +02:00

`write-request-line' writes absolute paths, not absolute URIs.

* module/web/http.scm (write-request-line): RFC 2616 says that absolute
  paths are used to identify resources on an origin server.
This commit is contained in:
Ian Price 2011-09-29 03:12:00 +01:00 committed by Andy Wingo
parent eaaf94c4ec
commit ab66fb3cd1

View file

@ -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))