Skip to content

Commit b6cccfc

Browse files
committed
Fix port syntax in host header of HTTP requests.
When constructing a host header, if PORT is an integer, add it to the header, otherwise omit it. The previous behavior resulted in host headers like "www.example.com:NIL", which failed on S3 but (confusingly) worked on CloudFront.
1 parent 9d68870 commit b6cccfc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

quicklisp/http.lisp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,9 @@ information."
365365
(apply #'add-strings sink strings)
366366
(add-newline sink)))
367367
(add-line method " " path " HTTP/1.1")
368-
(add-line "Host: " host (if (eql port 80) ""
369-
(format nil ":~D" port)))
368+
(add-line "Host: " host (if (integerp port)
369+
(format nil ":~D" port)
370+
""))
370371
(add-line "Connection: close")
371372
(add-line "User-Agent: " (user-agent-string))
372373
(add-newline sink)

0 commit comments

Comments
 (0)