[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 02/06: simplify reading http headers using updated %read
From: |
Mike Gran |
Subject: |
[Guile-commits] 02/06: simplify reading http headers using updated %read-line |
Date: |
Wed, 18 Apr 2018 12:00:29 -0400 (EDT) |
mike121 pushed a commit to branch wip-mingw-guile-2.2
in repository guile.
commit 6d325a7a27bb93299a5b75d3cf017f7ef3eb7048
Author: Michael Gran <address@hidden>
Date: Tue Apr 17 17:36:55 2018 -0700
simplify reading http headers using updated %read-line
%read-line can handle CRLF now.
* module/web/http.scm (read-header-line): modified
---
module/web/http.scm | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/module/web/http.scm b/module/web/http.scm
index de61c94..b3a8f1b 100644
--- a/module/web/http.scm
+++ b/module/web/http.scm
@@ -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))))
- [Guile-commits] branch wip-mingw-guile-2.2 updated (34131e3 -> 98f4024), Mike Gran, 2018/04/18
- [Guile-commits] 02/06: simplify reading http headers using updated %read-line,
Mike Gran <=
- [Guile-commits] 01/06: Let read-line handle alternate line endings, Mike Gran, 2018/04/18
- [Guile-commits] 03/06: Wrong preprocessor test for include guard for sys/select.h, Mike Gran, 2018/04/18
- [Guile-commits] 05/06: test shouldn't presume UTF-8 can be installed, Mike Gran, 2018/04/18
- [Guile-commits] 06/06: test-unwind leaks a file descriptor, Mike Gran, 2018/04/18
- [Guile-commits] 04/06: test-foreign-object-c needs libgnu, Mike Gran, 2018/04/18