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

210 commits

Author SHA1 Message Date
Dale P. Smith
29c27afe96 Allow trailing "." in urls
Fixes https://debbugs.gnu.org/53201

* module/web/uri.scm (valid-host?): Allow trailing "." in URLs
* test-suite/tests/web-uri.test: Add tests for trailing "."
2025-03-02 21:18:19 +01:00
Tomas Volf
f6359a4715
doc: srfi-19: Use day' instead of date' for `make-date'.
Looking at the SRFI-19 specification, the argument is called `day', not
`date'.  Even the accessor is called `date-day'.  So adjust the
documentation to match.

Also adjust the (web http) module, which was using `date' as well.

* doc/ref/srfi-modules.texi (SRFI-19 Date): Use `day' instead of `date'.
* module/web/http.scm (parse-rfc-822-date, parse-rfc-850-date)
(parse-asctime-date): Same.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-12-22 22:46:11 +01:00
Andy Wingo
bf4e8f911e Use custom binary output ports for make-chunked-output-port
* module/web/http.scm (make-chunked-output-port): Use custom binary
output ports.
2023-06-08 09:03:10 +02:00
Ludovic Courtès
e2ed33ef04
Remove unnecessary module imports.
These were found with:

  make GUILE_WARNINGS='-W1 -Wunused-module'

* module/ice-9/copy-tree.scm:
* module/ice-9/eval-string.scm:
* module/ice-9/getopt-long.scm:
* module/ice-9/poll.scm:
* module/ice-9/popen.scm:
* module/ice-9/sandbox.scm:
* module/ice-9/threads.scm:
* module/sxml/apply-templates.scm:
* module/sxml/simple.scm:
* module/system/base/types.scm:
* module/system/repl/command.scm:
* module/system/repl/common.scm:
* module/system/repl/coop-server.scm:
* module/system/repl/debug.scm:
* module/system/repl/error-handling.scm:
* module/system/repl/repl.scm:
* module/system/repl/server.scm:
* module/system/vm/assembler.scm:
* module/system/vm/disassembler.scm:
* module/system/vm/dwarf.scm:
* module/system/vm/elf.scm:
* module/system/vm/frame.scm:
* module/system/vm/inspect.scm:
* module/system/vm/linker.scm:
* module/system/vm/program.scm:
* module/system/vm/trace.scm:
* module/system/vm/trap-state.scm:
* module/system/vm/traps.scm:
* module/system/xref.scm:
* module/texinfo/indexing.scm:
* module/texinfo/plain-text.scm:
* module/texinfo/reflection.scm:
* module/texinfo/string-utils.scm:
* module/web/client.scm:
* module/web/http.scm:
* module/web/request.scm:
* module/web/response.scm: Remove imports of unused modules.
2023-02-24 16:49:00 +01:00
Ludovic Courtès
317b06bf86 web: 'tls-wrap' retries handshake upon non-fatal errors.
Fixes <https://bugs.gnu.org/49223>.
Reported by Domagoj Stolfa <ds815@gmx.com>.

Backport of Guix commit b36267b1d96ac344d2b42c9822ce04b4c3117f85.

* guix/build/download.scm (tls-wrap): Retry up to 5 times when
'handshake' throws a non-fatal error.
2022-08-04 15:59:23 +02:00
Ludovic Courtès
c01ca10b3f web: Do not wrap TLS port on GnuTLS >= 3.7.7.
The custom input/output port wrapping the TLS session record port would
introduce overhead, and it would also prevent its uses in a non-blocking
context--e.g., with Fibers.  The port close mechanism added in GnuTLS
3.7.7 allows us to get rid of that wrapper.

Backported from Guix commit dd573ceea73295c7a872088ecd91e5f0fd74bf2b.

* web/client.scm (wrap-record-port-for-gnutls<3.7.7): New procedure,
with code formerly in 'tls-wrap'.
(tls-wrap): Check for 'set-session-record-port-close!' and use it when
available; otherwise call 'wrap-record-port-for-gnutls<3.7.7'.
2022-08-04 15:59:23 +02:00
Christopher Baines
baa1424335 web: Don't hide missing data in the chunked input port.
This port is of limited use if it cannot be used reliably. Rather than
behaving as if the input has finished when it ends unexpectedly, instead
raise an exception.

* module/web/http.scm (make-chunked-input-port): Raise an exception on
premature termination.
(&chunked-input-ended-prematurely): New exception type.
(chunked-input-ended-prematurely-error?): New procedure.
* test-suite/tests/web-http.test (pass-if-named-exception): Rename to
pass-if-named-exception.
(pass-if-named-exception): New syntax.
("Exception on premature chunk end"): New test for this behaviour.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-07-04 11:22:13 +02:00
Christopher Baines
9a3353a993 web: Handle ending CRLF (\r\n) for chunked input and output ports.
The chunked transfer encoding specifies the chunked body ends with
CRLF. This is in addition to the CRLF at the end of the last chunk, so
there should be CRLF twice at the end of the chunked body:

  https://datatracker.ietf.org/doc/html/rfc2616#section-3.6.1

* module/web/http.scm (make-chunked-input-port): Read two extra bytes at
the end of the chunked input.
(make-chunked-output-port): Write the missing \r\n when closing the
port.
* test-suite/tests/web-http.test (chunked encoding): Add missing \r\n to
test data.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-07-04 11:22:11 +02:00
Aleix Conchillo Flaqué
a84d8f6473 web: send capitalized authorization header scheme
* module/web/http.scm (write-credentials): capitalize authorization
header scheme. The standard allows the scheme to be case-insensitive,
however most libraries out there expect the scheme to be capitalized,
which is what it is actually used in RFC
docs (e.g. https://datatracker.ietf.org/doc/html/rfc7617#section-2). Some
libraries even reject lowercase scheme making Guile incompatible.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-07-04 11:16:36 +02:00
Ludovic Courtès
c92f2c7df0 web: 'tls-wrap' returns an unbuffered custom port.
This mirrors Guix commit b168acae2a01fd84075cc134a6140594a978fde5.

* module/web/client.scm (tls-wrap)[unbuffered]: New procedure.
Pass the result of 'make-custom-binary-input/output-port' to
'unbuffered'.
2021-03-19 14:13:31 +01:00
Ludovic Courtès
e4f54d4b32 web: 'tls-wrap' avoids intermediate buffer.
This mirrors Guix commit 279d932b1ca7bfbb8657c41a84616dd0dfc6e0a8.

* module/web/client.scm (tls-wrap)[read!]:  Read straight into BV
instead of calling 'get-bytevector-some' and 'unget-bytevector'.
2021-03-19 14:08:58 +01:00
Andy Wingo
e30ee90478 Revert "Handle CRLF and Unicode line endings in read-line"
This reverts commit 0f983e3db0.

After discussing with Mike we are going to punt the read-line changes
for now.  Open the port in O_TEXT mode if you want to chomp the CR in
CFLF sequences.
2021-03-12 22:08:16 +01:00
Mike Gran
0f983e3db0 Handle CRLF and Unicode line endings in read-line
* libguile/rdelim.c (scm_read_line): handle CRLF, LS and PS
* module/ice-9/suspendable-ports.scm (read-line): handle CRLF, LS, and PS
* module/web/http.scm (read-header-line): take advantage of CRLF in read-line
   (read-header): don't need to test for \return
* test-suite/tests/rdelim.test: new tests for read-line CRLF, LS and PS
* doc/ref/api-io.texi: update doc for read-line
2021-03-11 19:42:33 -08:00
Andy Wingo
0f42fef119 Add call-with-input-bytevector, call-with-output-bytevector
* module/ice-9/binary-ports.scm (call-with-input-bytevector):
  (call-with-output-bytevector): New functions.
* module/ice-9/iconv.scm: Remove superfluous copies of
  call-with-output-string* and call-with-output-bytevector*, now that
  the former closes the port and the latter exists.
  (call-with-encoded-output-string): Adapt.
* module/web/uri.scm: Use (ice-9 iconv) instead of local
  bytevector/string conversion procedures.
2021-01-12 12:09:19 +01:00
Andy Wingo
e9c5a1719b Move copy-tree to (ice-9 copy-tree); deprecate main binding
* doc/ref/api-data.texi (List Constructors):
* doc/ref/api-utility.texi (Copying): Update docs to mention module.
* libguile.h: Remove trees.h inclusion.
* libguile/Makefile.am (libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
  (DOT_X_FILES, DOT_DOC_FILES, modinclude_HEADERS): Remove trees.c,
  trees.h, and related files.
* libguile/init.c (scm_i_init_guile): Remove trees.h and the
  scm_init_trees call.
* libguile/trees.c:
* libguile/trees.h: Remove.
* module/Makefile.am (SOURCES): Add ice-9/copy-tree.scm.
* module/ice-9/copy-tree.scm: New file.
* module/ice-9/deprecated.scm (copy-tree*): Export as copy-tree,
  proxying to (ice-9 copy-tree).
* module/system/repl/common.scm:
* module/web/client.scm:
* test-suite/tests/elisp.test:
* test-suite/tests/srfi-1.test:
* module/oop/goops/save.scm: Use (ice-9 copy-tree).
* test-suite/Makefile.am (SCM_TESTS): Add copy-tree.test.
* test-suite/tests/copy-tree.test: New file; test pulled from
  eval.test.
* libguile/deprecated.h:
* libguile/deprecated.c (scm_copy_tree): Deprecate.
2020-09-10 21:57:21 +02:00
Ludovic Courtès
1ab2105339 web: Accept URI host names consisting only of hex digits.
Fixes <https://bugs.gnu.org/40582>.
Reported by Julien Lepiller <julien@lepiller.eu>.

Previously, a host part consisting of hex digits would be mistaken as an
IPv6 address and rejected by 'valid-host?'.

* module/web/uri.scm (ipv6-regexp): Add colon.
* test-suite/tests/web-uri.test ("string->uri")["xyz://abc/x/y/z"]: New
test.
* NEWS: Update.
2020-06-18 17:06:29 +02:00
Ludovic Courtès
a5421d2bb6 web: 'http-get' & co. now honor #:verify-certificate?.
Previously they would always assume #:verify-certificate? #t,
unless #:port was given.

Fixes <https://bugs.gnu.org/40486>.
Reported by Jan Synacek <jsynacek@redhat.com>.

* module/web/client.scm (define-http-verb): Pass #:verify-certificate?
to 'open-socket-for-uri'.
2020-05-27 23:28:14 +02:00
Christopher Baines
ac5df66f1c http: Support CONNECT and PATCH HTTP methods.
PATCH is described by RFC 5789 and CONNECT is described by RFC 7231.

* module/web/http.scm (parse-http-method): Support CONNECT and PATCH.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-05-18 09:44:00 +02:00
Ludovic Courtès
076276c4f5 web: Client treats TLS "premature termination" error as EOF.
Fixes <https://bugs.gnu.org/39800>.
Reported by <franco.rcr@gmail.com>.

* module/web/client.scm (tls-wrap)[read!]: Catch 'gnutls-error around
'get-bytevector-some' call.
2020-03-06 23:04:12 +01:00
Ludovic Courtès
c3daf58b89 web: Update comment regarding the 'tls-wrap' port wrapper.
* module/web/client.scm (tls-wrap): Update comment.
2020-01-13 11:07:05 +01:00
Ludovic Courtès
38f14ce65d web: 'open-socket-for-uri' can verify the server's X.509 certificate.
This is largely based on Guix commit
bc3c41ce36349ed4ec758c70b48a7059e363043a and subsequent changes to that
code.

* module/web/client.scm (x509-certificate-directory): New variable.
(set-certificate-credentials-x509-trust-file!*)
(make-credendials-with-ca-trust-files, peer-certificate)
(assert-valid-server-certificate, print-tls-certificate-error): New
procedures.
<top level>: Add call to 'set-exception-printer!'.
(tls-wrap): Add #:verify-certificate? parameter.  When it is true, call
'make-credendials-with-ca-trust-files', pass it to
'set-session-credentials!', and call 'assert-valid-server-certificate'.
(open-socket-for-uri): Add #:verify-certificate? parameter and pass it
to 'tls-wrap'.
(http-request): Add #:verify-certificate? parameter and pass it to
'open-socket-for-uri'.
(define-http-verb): Add #:verify-certificate? parameter and pass it to
'http-request'.
* doc/ref/web.texi (Web Client): Update documentation of
'open-socket-for-uri' and 'http-request'.  Document
'x509-certificate-directory'.
2020-01-13 11:06:01 +01:00
Ludovic Courtès
bcba213284 web: Continue handshake upon TLS warning alerts.
This is a backport of Guix commit 7b9ac883ea62a816afbfa747c1377dc273c15c20.

* module/web/client.scm (tls-wrap): Catch 'gnutls-error' around
'handshake'.  Upon ERROR/WARNING-ALERT-RECEIVED, print a message and
call 'handshake'.
2020-01-13 11:06:01 +01:00
Ludovic Courtès
80bbebef4d web: Add 'current-https-proxy' and honor $https_proxy.
* module/web/client.scm (current-https-proxy): New variable.
(setup-http-tunnel): New procedure.
(open-socket-for-uri): Move 'http-proxy', 'uri', and 'addresses' inside
'open-socket'.  Remove 'with-https-proxy' macro.  Add call to
'setup-http-tunnel'.  Honor 'current-https-proxy' in 'open-socket'.
* doc/ref/web.texi (Web Client): Document 'current-https-proxy'.
* doc/ref/guile.texi: Update copyright years.

Based on Guix commit 9bc8175cfa6b23c31f6c43531377d266456e430e.

Co-authored-by: Sou Bunnbu (宋文武) <iyzsong@gmail.com>
2020-01-13 11:06:01 +01:00
Ludovic Courtès
c9b83a27c7 web: Adjust (gnutls) loading to new module autoload semantics.
Prior to commit cb14fd2143 (Guile 2.9.7),
autoloading a module would give you access to all its bindings.  In
future versions, autoloading a module gives access only to the listed
bindings, as per #:select (see <https://bugs.gnu.org/38895>).

This commit adjusts autoloads to the new semantics, fixing a regression
introduced in cb14fd2143.

* module/web/client.scm <top level>: Remove 'module-autoload!' call.
(gnutls-module, ensure-gnutls): Remove.
(load-gnutls): New procedure.
(tls-wrap): Call it instead of 'ensure-gnutls'.  Replace reference to
GNUTLS-MODULE by a call to 'resolve-interface'.
2020-01-13 11:06:01 +01:00
Andy Wingo
8ee6e766b8 Merge from stable-2.2 2019-08-02 15:30:13 +02:00
Andy Wingo
160a5c89bf Merge from stable-2.2 2019-08-02 15:21:34 +02:00
Andy Wingo
6a102205da Merge from stable-2.2 2019-08-02 14:32:35 +02:00
Mark H Weaver
e1225d013e Revert "web: Add support for HTTP header continuation lines."
Fixes <https://bugs.gnu.org/36350>.

This reverts commit 73cde5ed72.
2019-06-24 11:33:13 -04:00
Mark H Weaver
73cde5ed72 web: Add support for HTTP header continuation lines.
* module/web/http.scm (spaces-and-tabs, space-or-tab?): New variables.
(read-header-line): After reading a header, if a space or tab follows,
read the continuation lines and join them.
* test-suite/tests/web-http.test: Add test.
2019-06-18 08:28:01 -04:00
Timothy Sample
420c2632bb Make URI handling locale independent.
Fixes <https://bugs.gnu.org/35785>.

* module/web/uri.scm (digits, hex-digits, letters): New variables.
(ipv4-regexp, ipv6-regexp, domain-label-regexp, top-label-regexp,
userinfo-pat, host-pat, ipv6-host-pat, port-pat, scheme-pat): Explicitly
list each character instead of using character ranges.
* test-suite/tests/web-uri.test: Add corresponding tests.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2019-06-04 21:24:02 +02:00
Arun Isaac
e40b5b54ff web: Export http-request.
* module/web/client.scm (request): Rename to http-request, add a
docstring, and export it.
(http-get, http-head, http-post, http-put, http-delete, http-trace,
http-options): Update docstring.
* doc/ref/web.texi (Web Client): Document http-request.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2018-08-07 12:13:19 +02:00
Arun Isaac
919979ac39 web: Export http-request.
* module/web/client.scm (request): Rename to http-request, add a
docstring, and export it.
(http-get, http-head, http-post, http-put, http-delete, http-trace,
http-options): Update docstring.
* doc/ref/web.texi (Web Client): Document http-request.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2018-06-23 23:32:13 +02:00
Andy Wingo
e10999be2e Merge until 2fe9a852fb from stable-2.2 2017-11-29 21:12:01 +01:00
Ludovic Courtès
6ad28ae3bc http: Fix typo in proxy handling in 'write-request-line'.
Reported by Mark H Weaver <mhw@netris.org>
at <https://lists.gnu.org/archive/html/guix-devel/2017-11/msg00190.html>.

* module/web/http.scm (write-request-line): Fix more typos introduced in
96b994b6f8.
2017-11-11 15:14:54 +01:00
Ludovic Courtès
7d0d9e2c25 http: Fix typo in proxy handling in 'write-request-line'.
Reported by Konrad Hinsen <konrad.hinsen@fastmail.net>
at <https://lists.gnu.org/archive/html/guix-devel/2017-11/msg00070.html>.

* module/web/http.scm (write-request-line): Move 'string-index' first in
'cond' clause.  Fixes a regression introduced in
96b994b6f8.
2017-11-10 22:54:49 +01:00
Andy Wingo
c248ea10be Remove all deprecated code
* module/ice-9/debug.scm:
* module/ice-9/mapping.scm:
* module/ice-9/syncase.scm: Delete these deprecated files.
* module/Makefile.am: Remove deleted files.
* libguile/deprecated.c:
* libguile/deprecated.h:
* libguile/backtrace.c:
* libguile/goops.c:
* libguile/numbers.c:
* libguile/socket.c:
* libguile/srfi-13.c:
* module/ice-9/deprecated.scm:
* module/ice-9/format.scm:
* module/oop/goops.scm:
* module/statprof.scm:
* module/texinfo/reflection.scm:
* module/web/client.scm:
* module/web/uri.scm: Remove deprecated code.
2017-05-22 13:36:42 +02:00
Andy Wingo
7095a536f3 web: add support for URI-reference
Based on a patch by Daniel Hartwig <mandyke@gmail.com>.

* NEWS: Update.
* doc/ref/web.texi (URIs): Fragments are properly part of a URI, so
  remove the incorrect note.  Add documentation on URI subtypes.
* module/web/uri.scm (uri-reference?): New base type predicate.
  (uri?, relative-ref?): Specific predicates.
  (validate-uri-reference): Strict validation.
  (validate-uri, validate-relative-ref): Specific validators.
  (build-uri-reference, build-relative-ref): New constructors.
  (string->uri-reference): Rename from string->uri.
  (string->uri, string->relative-ref): Specific constructors.
  (uri->string): Add #:include-fragment? keyword argument.
* module/web/http.scm (parse-request-uri): Use `build-uri-reference',
  and result is a URI-reference, not URI, object.  No longer infer an
  absent `uri-scheme' is `http'.
  (write-uri): Just use `uri->string'.
  (declare-uri-header!): Remove unused function.
  (declare-uri-reference-header!): Update.  Rename from
  `declare-relative-uri-header!'.
* test-suite/tests/web-uri.test ("build-uri-reference"):
  ("string->uri-reference"): Add.
  ("uri->string"): Also tests for relative-refs.
* test-suite/tests/web-http.test ("read-request-line"):
  ("write-request-line"): Update for no scheme in some URIs.
  ("entity headers", "request headers"): Content-location, Referer, and
  Location should also parse relative-URIs.
* test-suite/tests/web-request.test ("example-1"): Expect URI-reference
  with no scheme.
2017-05-21 13:42:29 +02:00
Andy Wingo
0c102b56e9 Fix reading of HTTPS responses that are smaller than port buffer
* module/web/client.scm (tls-wrap): Use get-bytevector-some instead of
  get-bytevector-n, to prevent Guile from attempting to read more bytes
  than are available.  Normally trying to read data on a shut-down
  socket is fine, but but gnutls issues an error if you attempt to read
  data from a shut-down socket, and that appears to be a security
  property.  Fixes HTTPS requests whose responses are smaller than the
  port buffer.
2017-04-28 13:38:41 +02:00
Ludovic Courtès
aa86fcb7d9 web: Avoid deprecated '_IOFBF'.
* module/web/client.scm (open-socket-for-uri): Use 'block instead of
_IOFBF.
2017-03-17 23:37:57 +01:00
Ludovic Courtès
011669af3b web: Remove export of nonexistent 'open-connection-for-uri'.
* module/web/client.scm: Don't export 'open-connection-for-uri', which
doesn't exist.
2017-03-17 23:35:24 +01:00
Mark H Weaver
b56b944920 http: Do not use 'eq?' to compare characters in parse-request-uri.
* module/web/http.scm (parse-request-uri): Use 'eqv?' to compare
characters.
2017-03-01 19:50:37 +01:00
Andy Wingo
710ebfddc6 Web server and client use suspendable ports
* module/web/request.scm (write-request):
* module/web/response.scm (write-response): Use put-string instead of
  display.
2017-02-08 15:16:25 +01:00
Andy Wingo
ecdff904cb Remove remaining "display" uses in (web http)
* module/web/http.scm (header-writer): Default to calling put-string.
  (put-list): Rename from write-list, take the port first, and call the
  put-item function with port then value.  Adapt all callers.
  (write-date): Rename display-digits to put-digits.
  (put-challenge): Rename from write-challenge, adapt arguments to put
  convention, and adapt callers.
  (declare-symbol-list-header!): Use put-symbol.
  (declare-integer-header!): Use put-non-negative-integer.o
  (declare-entity-tag-list-header!): Use put-entity-tag-list.
  ("If-Range", "Etag"): Adapt to put-entity-tag.
  (make-chunked-output-port): Use put-char.
2017-02-08 15:09:14 +01:00
Andy Wingo
96b994b6f8 Beginnings of suspendable HTTP
* module/web/http.scm: Use put-string and other routines from (ice-9
  textual-ports) in preference to `display'.  The goal is for these
  operations to be suspendable.
2017-02-08 15:09:14 +01:00
Andy Wingo
8c50060ae9 Modernize (web http) a bit
* module/web/http.scm: Modernize the Guile Scheme by using more match,
  when, unless, and non-tail conversion.  No functional change, with the
  exception of fixing a bug in write-key-value-list for symbols like
  100-continue that shouldn't print as #{100-continue}#.
* test-suite/tests/web-http.test (pass-if-only-parse):
  (pass-if-reparse, pass-if-parse): Arrange to also serialize and
  reparse values from pass-if-parse.  Apply to all existing tests except
  fragments where we don't expect fragments to be written out.
2017-02-08 15:09:14 +01:00
Christopher Allan Webber
8f1db9f268 web: Add https support through gnutls.
Since importing gnutls directly would result in a dependency cycle,
we load gnutls lazily.

This uses code originally written for Guix by Ludovic Courtès.

* module/web/client.scm: (%http-receive-buffer-size)
  (gnutls-module, ensure-gnutls, gnutls-ref, tls-wrap): New variables.
  (open-socket-for-uri): Wrap in tls when uri scheme is https.
* doc/ref/web.texi (open-socket-for-uri): Document gnutls usage.
2016-11-07 12:05:30 -06:00
Andy Wingo
342bd8dfb3 ETag list headers accept sloppy etags
* module/web/http.scm (parse-entity-tag): Add #:sloppy-delimiters
  keyword argument, and return a second value indicating the end
  position.
  (parse-entity-tag-list): Use parse-entity-tag, so that we also accept
  sloppy etags that aren't qstrings.
* test-suite/tests/web-http.test ("request headers"): Add a test.
2016-08-28 13:48:42 +02:00
Andy Wingo
687d393e2c Fix uri-decode behavior for "+"
* module/web/uri.scm (uri-decode): Add #:decode-plus-to-space? keyword
  argument.
  (split-and-decode-uri-path): Don't decode plus to space.
* doc/ref/web.texi (URIs): Update documentation.
* test-suite/tests/web-uri.test ("decode"): Add tests.
* NEWS: Add entry.

Based on a patch by Brent <brent@tomski.co.za>.
2016-06-20 14:48:15 +02:00
Ludovic Courtès
b9f6e89a27 http: Accept date strings with a leading space for hours.
Fixes <http://bugs.gnu.org/23421>.
Reported by Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>.

* module/web/http.scm (parse-rfc-822-date): Add two clauses for hours
with a leading space.
* test-suite/tests/web-http.test ("general headers"): Add two tests.
2016-05-22 20:14:34 +02:00
Ludovic Courtès
66bc464542 http: Use 'read-header-line' instead of 'read-line*'.
* module/web/http.scm (read-line*): Remove.
(read-continuation-line, read-header, read-request-line): Use
'read-header-line' instead of 'read-line*'.
2016-05-22 20:02:37 +02:00