DescriptionDo "path normalization" when creating a URI.
Path normaliztion removes '.' and '..' segments from a URI. Such relative references are only intended for URI References, and Uri References are only intended for resolving against a full URI.
We do path normalization on all URIs that have a scheme, authority or an absolute path, and partial normalization on what are really just relative paths. The partial normalization can leave ".." at the start of the path.
The URI reference resolution algorithm doesn't work as expected for a URI ending in "..". Resolving "./foo" wrt. a base of "/a/.." results in "/a/foo" - this is avoided when the base is path normalized before it's used.
This also fixes the "normalizePath" function which currently removes leading '..' segments, contrary to its documentation. It also makes the function redundant since all URI paths are normalized automatically.
See discussion on http://dartbug.com/23688
Also fix bug in the removeDotSegments function.
R=floitsch@google.com
Committed: https://github.com/dart-lang/sdk/commit/848f6c978c7be89ede9db0c990289d5975ea391c
Patch Set 1 #
Total comments: 23
Patch Set 2 : update CHANGELOG.md #Patch Set 3 : Address comments. #
Messages
Total messages: 8 (2 generated)
|