| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* module/web/uri.scm (validate-uri): Add reference? keyword argument,
for validating references.
(build-uri): Clarify comments to indicate that the result is an
absolute URI.
(build-uri-reference): New interface, to build URI-references.
(string->uri-reference): Rename from string->uri*. Fix fragment
parsing to not include the #.
(string->uri): Adapt to string->uri-reference name change.
* module/web/request.scm (request-absolute-uri): Add default-scheme
optional argument. Use it if the request-uri has no scheme, or
error.
* module/web/http.scm (write-uri): Reflow to use "when". Fix writing of
URI-reference instances.
(declare-uri-reference-header!): Rename from
declare-relative-uri-header!. Use string->uri-reference.
("Location"): Declare as a URI-reference header, as per RFC 7231.
* module/web/client.scm (open-socket-for-uri): Handle the case in which
there is no URI scheme.
* test-suite/tests/web-http.test:
* test-suite/tests/web-uri.test: Add tests.
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
| |
* 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 (uri-encode): All encoded octets should be of the
form % HEXDIGIT HEXDIGIT.
* test-suite/tests/web-uri.test ("encode"): Add test.
|
|
|
|
|
| |
* test-suite/tests/web-uri.test: Disable some tests if we don't have
inet-pton.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
| |
* test-suite/tests/web-uri.test ("string->uri"): Add test for
string->uri with hosts beginning in digits.
|
|
|
|
|
|
| |
* 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 (string->uri, uri->string): Rename from parse-uri
and unparse-uri.
* test-suite/tests/web-uri.test:
* module/web/http.scm: All callers changed.
|
|
|
|
|
|
|
| |
* 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.
|
|
* module/web/uri.scm: Reimplement for RFC 3986.
* module/Makefile.am: Add to build.
* test-suite/Makefile.am:
* test-suite/tests/web-uri.test: Add tests.
|