in PARSE-HTTP-REQUEST: catch errors thrown by READ-RFC822-HEADERS and

answer 400 instead of 500 for requests with bad headers
This commit is contained in:
vibr 2005-04-16 20:22:41 +00:00
parent 0554b2d494
commit 36db985453
1 changed files with 4 additions and 1 deletions

View File

@ -243,7 +243,10 @@
(url (url-string->http-url request-uri)) (url (url-string->http-url request-uri))
(headers (if (equal? version '(0 . 9)) (headers (if (equal? version '(0 . 9))
'() '()
(read-rfc822-headers (socket:inport sock))))) (with-fatal-error-handler
(lambda (c decline)
(fatal-syntax-error "Illegal RFC 822 field syntax of request headers"))
(read-rfc822-headers (socket:inport sock))))))
(make-request meth request-uri url version headers sock))))) (make-request meth request-uri url version headers sock)))))