[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 10/11: simplify reading http headers using updated %read
From: |
Mike Gran |
Subject: |
[Guile-commits] 10/11: simplify reading http headers using updated %read-line |
Date: |
Sun, 24 Jan 2021 01:28:50 -0500 (EST) |
mike121 pushed a commit to branch mingw-guile-3.0
in repository guile.
commit 9a2e9a6440acdd3664ed1b062626424a836b5e3d
Author: Michael Gran <spk121@yahoo.com>
AuthorDate: 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 4276e17..86bd912 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 mingw-guile-3.0 created (now c8990b7), Mike Gran, 2021/01/24
- [Guile-commits] 01/11: disable popen 'no duplicates' test for MinGW, Mike Gran, 2021/01/24
- [Guile-commits] 03/11: Add Win32 compatibility to JIT, Mike Gran, 2021/01/24
- [Guile-commits] 05/11: ice-9 ftw: handle missing getuid and getgid, Mike Gran, 2021/01/24
- [Guile-commits] 07/11: ftw test should handle missing symlink procedure, Mike Gran, 2021/01/24
- [Guile-commits] 04/11: On Win32, prefer winsock2 header for socket declarations, Mike Gran, 2021/01/24
- [Guile-commits] 06/11: ice-9 ftw: handle non-working inodes, Mike Gran, 2021/01/24
- [Guile-commits] 08/11: Let read-line handle alternate line endings, Mike Gran, 2021/01/24
- [Guile-commits] 02/11: remove 2nd attempt at invoking ComSpec when spawning child, Mike Gran, 2021/01/24
- [Guile-commits] 09/11: Let suspendable ports' read-line handle alternate line endings, Mike Gran, 2021/01/24
- [Guile-commits] 10/11: simplify reading http headers using updated %read-line,
Mike Gran <=
- [Guile-commits] 11/11: For MinGW use Windows filepaths in libpath.h, Mike Gran, 2021/01/24