1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 20:00:19 +02:00

http: Test that responses lacking CR/LF are rejected.

* test-suite/tests/web-http.test ("read-response-line")["missing
CR/LF"]: New test.
This commit is contained in:
Ludovic Courtès 2016-01-06 15:06:52 +01:00 committed by Andy Wingo
parent 95d146ff51
commit 3829047ec7

View file

@ -186,6 +186,11 @@
(1 . 1))) (1 . 1)))
(with-test-prefix "read-response-line" (with-test-prefix "read-response-line"
(pass-if-exception "missing CR/LF"
`(bad-header . "")
(call-with-input-string "HTTP/1.1 200 Almost okay"
(lambda (port)
(read-response-line port))))
(pass-if-read-response-line "HTTP/1.0 404 Not Found" (pass-if-read-response-line "HTTP/1.0 404 Not Found"
(1 . 0) 404 "Not Found") (1 . 0) 404 "Not Found")
(pass-if-read-response-line "HTTP/1.1 200 OK" (pass-if-read-response-line "HTTP/1.1 200 OK"