* 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.