Update documentation for URI parsing types

See gh-33639
This commit is contained in:
rstoyanchev
2024-10-07 09:56:57 +01:00
parent 6c62965cbb
commit ef0a21ec7a
3 changed files with 70 additions and 40 deletions

View File

@@ -234,6 +234,34 @@ Kotlin::
======
[[uri-parsing]]
= URI Parsing
[.small]#Spring MVC and Spring WebFlux#
`UriComponentsBuilder` supports two URI parser types:
1. RFC parser -- this parser type expects URI strings to conform to RFC 3986 syntax,
and treats deviations from the syntax as illegal.
2. WhatWG parser -- this parser is based on the
https://github.com/web-platform-tests/wpt/tree/master/url[URL parsing algorithm] in the
https://url.spec.whatwg.org[WhatWG URL Living standard]. It provides lenient handling of
a wide range of cases of unexpected input. Browsers implement this in order to handle
leniently user typed URL's. For more details, see the URL Living Standard and URL parsing
https://github.com/web-platform-tests/wpt/tree/master/url[test cases].
By default, `RestClient`, `WebClient`, and `RestTemplate` use the RFC parser type, and
expect applications to provide with URL templates that conform to RFC syntax. To change
that you can customize the `UriBuilderFactory` on any of the clients.
Applications and frameworks may further rely on `UriComponentsBuilder` for their own needs
to parse user provided URL's in order to inspect and possibly validated URI components
such as the scheme, host, port, path, and query. Such components can decide to use the
WhatWG parser type in order to handle URL's more leniently, and to align with the way
browsers parse URI's, in case of a redirect to the input URL or if it is included in a
response to a browser.
[[uri-encoding]]
= URI Encoding
[.small]#Spring MVC and Spring WebFlux#