Please sign in to comment.
Fix inconsistencies with URI::Path
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) <email@example.com> Reviewed-by: Jeremy Stanley <firstname.lastname@example.org>
- Loading branch information...
Showing with 278 additions and 107 deletions.
Oops, something went wrong.