forked from mozy/mordor
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
URI paths are now defined as "there is a slash between each segment". So, "http://localhost/" ends up with two path segments, both empty. In practice, this means a trailing slash always has a trailing empty element, and a leading slash (an absolute path) always has a leading empty element. The path "/" has two empty elements, which seems a bit odd, but makes everything else work generally, especially the parser. A single empty element doesn't make much sense, but is handled okay, and treated as if it is a fully empty path. Add a helper function for easily appending a path element without creating a double-slash (replaces the last element with new element if the last element is empty). Add some unit tests, and also fix a few minor URI bugs: * scheme was defined incorrectly (it must start with an alpha) * Fix serializing of a URI with no authority, and an absolute path starting with two slashes * Fix transform where the base uri does not have a path Change-Id: Ib6b86a14886dabfe3f717631c56323b768ea44dc Reviewed-on: https://gerrit.dechocorp.com/10207 Reviewed-by: Punky Brewster (labs admin) <punkyb@example.com> Reviewed-by: Jeremy Stanley <jeremy@mozy.com>
- Loading branch information
Showing
8 changed files
with
278 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.