mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
Modify http header parser to use new read-line "\r\n" handling
* module/web/http.scm (read-header-line): modify for new read-line
This commit is contained in:
parent
9bb8793a6c
commit
993ac2fd74
1 changed files with 5 additions and 6 deletions
|
@ -157,13 +157,12 @@ The default writer will call ‘put-string’."
|
|||
Raise a 'bad-header' exception if the line does not end in CRLF or LF,
|
||||
or if EOF is reached."
|
||||
(match (%read-line port)
|
||||
(((? string? line) . "\r\n")
|
||||
line)
|
||||
(((? string? line) . #\newline)
|
||||
;; '%read-line' does not consider #\return a delimiter; so if it's
|
||||
;; there, remove it. We are more tolerant than the RFC in that we
|
||||
;; tolerate LF-only endings.
|
||||
(if (string-suffix? "\r" line)
|
||||
(string-drop-right line 1)
|
||||
line))
|
||||
;; We are more tolerant than the RFC in that we tolerate LF-only
|
||||
;; endings.
|
||||
line)
|
||||
((line . _) ;EOF or missing delimiter
|
||||
(bad-header 'read-header-line line))))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue