Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Issue 1224263009: Do "path normalization" when creating a URI. (Closed)

Created:
5 years, 5 months ago by Lasse Reichstein Nielsen
Modified:
5 years, 5 months ago
Reviewers:
floitsch, kevmoo
CC:
reviews_dartlang.org
Base URL:
https://github.com/dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Do "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. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+258 lines, -100 lines) Patch
M CHANGELOG.md View 1 2 1 chunk +6 lines, -0 lines 0 comments Download
M sdk/lib/core/uri.dart View 1 2 15 chunks +149 lines, -38 lines 0 comments Download
M tests/corelib/uri_normalize_path_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/corelib/uri_normalize_test.dart View 2 chunks +39 lines, -4 lines 0 comments Download
M tests/corelib/uri_test.dart View 2 chunks +63 lines, -57 lines 0 comments Download

Messages

Total messages: 8 (2 generated)
Lasse Reichstein Nielsen
5 years, 5 months ago (2015-07-17 10:34:23 UTC) #2
floitsch
LGTM. https://codereview.chromium.org/1224263009/diff/1/sdk/lib/core/uri.dart File sdk/lib/core/uri.dart (right): https://codereview.chromium.org/1224263009/diff/1/sdk/lib/core/uri.dart#newcode384 sdk/lib/core/uri.dart:384: bool hasAuthority = host != null; nit: (host ...
5 years, 5 months ago (2015-07-17 13:03:20 UTC) #3
Lasse Reichstein Nielsen
Committed patchset #3 (id:40001) manually as 848f6c978c7be89ede9db0c990289d5975ea391c (presubmit successful).
5 years, 5 months ago (2015-07-17 15:09:10 UTC) #4
kevmoo
On 2015/07/17 15:09:10, Lasse Reichstein Nielsen wrote: > Committed patchset #3 (id:40001) manually as > ...
5 years, 5 months ago (2015-07-17 16:42:53 UTC) #5
Lasse Reichstein Nielsen
https://codereview.chromium.org/1224263009/diff/1/sdk/lib/core/uri.dart File sdk/lib/core/uri.dart (right): https://codereview.chromium.org/1224263009/diff/1/sdk/lib/core/uri.dart#newcode384 sdk/lib/core/uri.dart:384: bool hasAuthority = host != null; Done. https://codereview.chromium.org/1224263009/diff/1/sdk/lib/core/uri.dart#newcode516 sdk/lib/core/uri.dart:516: ...
5 years, 5 months ago (2015-07-17 18:40:23 UTC) #6
kevmoo
5 years, 5 months ago (2015-07-21 17:10:59 UTC) #8
Message was sent while issue was closed.
Please update changelog w/ the three added properties: hasAbsolutePath,
hasEmptyPath, hasScheme

Powered by Google App Engine
This is Rietveld 408576698