* module/web/uri.scm (uri-encode): the hexadecimal percent-encoding %HH
is now uppercased as suggested by RFC3986:
"For consistency, URI producers and normalizers should use
uppercase hexadecimal digits for all percent-encodings."
* test-suite/tests/web-uri.test ("encode"): update tests.
* doc/ref/web.texi: Say `World Wide Web'; the hyphenated form is almost
never used (c.f. w3.org).
General predicate arguments are named `obj'. Fill in arguments
omitted from some procedure definitions (e.g. `request-method').
Minor tweaks, such as using en-dash and missing markup as appropriate.
Wrap very long deffn lines.
* module/web/*.scm: Expand texinfo markup in doc strings. Synchronize
with changes in web.texi.
* module/web/uri.scm (uri-pat): Make scheme part optional.
(string->uri*): New private procedure to also parse relative URIs.
* module/web/http.scm (declare-relative-uri-header!): Use that.
* doc/ref/web.texi: Fix spacing. Update with a few missing function
descriptions.
* module/web/client.scm:
* module/web/http.scm:
* module/web/request.scm:
* module/web/server.scm:
* module/web/uri.scm: Update docstrings from manual (reworked by Ludovic
Courtès).
* module/web/uri.scm (uri-encode): Change test to check for unreserved
chars instead of reserved chars.
* test-suite/tests/web-uri.test ("encode"): Add test.
* module/web/uri.scm (ipv6-regexp): IPv6 numeric addresses do not have
brackets. It's only in URIs that they have them.
(ipv6-host-pat, authority-regexp, parse-authority): Refactor ipv6
detection to fix a bug with |, and to extract IPv6 hosts from their
brackets. This way we can pass the uri-host directly to inet-pton.
(uri->string): If the host contains a `:', assume it is ipv6 and add
brackets.
* test-suite/tests/web-uri.test ("build-uri"): Adapt tests to assume
that the address returned by uri-host and passed to build-uri #:host
does not have brackets.
* module/web/uri.scm (valid-host?): Support dotted-quad notation
in IPv6 addresses.
(parse-authority): Support IPv6 literals.
* test-suite/tests/web-uri.test: Add and fix tests.
* module/web/uri.scm (valid-host?): Fix regexp to support
domain names starting with numbers.
* test-suite/tests/web-uri.scm: Add tests for above and
IP literals.
* module/web/uri.scm (parse-authority): Allow empty authorities, so that
we accept URIs of the form, file:///etc/hosts.
* test-suite/tests/web-uri.test ("string->uri"): Add tests.
* module/web/uri.scm:
* module/web/server.scm (call-with-output-string*):
(call-with-output-bytevector*): Local procs to output to strings or
bytevectors, *and then close the port*. We can't make this change in
call-with-output-string because it would be incompatible.
* module/web/uri.scm (call-with-encoded-output-string, decode-string)
(uri-decode)
* module/web/server.scm (call-with-encoded-output-string): Use the new
helpers.
* module/web/uri.scm (call-with-encoded-output-string, encode-string)
(decode-string, uri-decode, uri-encode): Change all instances of
"charset" to "encoding", as variables and arguments.
* module/web/server.scm (call-with-encoded-output-string): Fix some code
I accidentally left in while testing. Re-tested the difference in
speed; pleasantly surprised.
* module/web/uri.scm: Make the same change here.
* module/web/uri.scm (call-with-encoded-output-string, encode-string):
Copy from server.scm
(decode-string): Copy from tekuti.
(uri-decode): The #:charset arg is a string, like
port-encoding. Support other charsets.
(uri-encode): Charset is a string. Other encodings still not nicely
supported. Hmm.
* module/web/uri.scm (declare-default-port!): New function, declares a
default port for a scheme. Predeclare default ports for http and
https.
(unparse-uri): If the port is the default port for the given scheme,
don't serialize the port part of the URI.
* module/web/uri.scm (uri-error): New proc, throws to 'uri-error.
(validate-uri, uri-decode, uri-encode): Use uri-error.
* test-suite/tests/web-uri.test: Update for uri-error.