Several fixes to URI.merge/2 related to trailing slashes, trailing dots, and hostless base URIs
Module
URI
37 changes across 27 versions
Changes by version
Fix a bug when a schemaless URI is given to URI.merge/2
Ensure :undefined fields are properly converted to nil when invoking Erlang's API
Ensure :undefined fields are properly converted to nil when invoking Erlang's API
Add URI.append_path/2
Make sure URI.merge/2 works accordingly with relative paths
Do not return uri.port as :undefined in certain cases in URI.new/1
Add URI.append_query/2
Undeprecate URI.parse/1 as URI.new/1 is too strict in many common cases
Make sure URI.new/1 returns nil for empty paths
Add URI.new/1 and URI.new!/1
Only percent decode if followed by hex digits (according to https://url.spec.whatwg.org/#percent-decode)
URI.parse/1 is deprecated in favor of URI.new/1 and URI.new!/1
Support RFC3986 compliant encoding and decoding of queries via the :rfc3986 option
Do not discard empty paths on URI.merge/2
URI.decode_query/2 emits an empty string for parameters without values, according to URL's living standard - note this behaviour is not specified in the spec implemented by the URI module, so the living standard was chosen
Preserve slashes in URIs without authority
Require a nil or an absolute path on URIs with host or authority
Fix parsing of URIs with trailing ?
Preserve empty fragments in URI.parse/1
Allow 0 as URI scheme default port
Add URI.merge/2
Use square brackets for IPv6 in URI.to_string/1
Passing a non-map to URI.decode_query/2 is deprecated
Default ports were added for "ws" and "wss" schemas
Add URI.to_string/1
Speed decoding operations
Do more strict matching on URI schema
to_string/1 now properly converts URI to strings when the schema is missing
Allow parse/1 now accepts %URI{} as argument and return the uri itself
encode/1 does not escape reserved/unreserved characters by default nor encodes whitespace as + (check URI.encode_www_form/1 and URI.decode_www_form/1 for previous behaviour)
The URI.Info record has now become the URI struct
URI.decode_query/1 is deprecated in favor of URI.decode_query/2 with explicit dict argument
Passing lists as key or values in URI.encode_query/1 is deprecated
Allow lowercase escapes in URI
URI.parse/1 supports IPv6 addresses
Remove custom URI parsers in favor of URI.default_port/2