Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
capnproto
Commits
cb69ee19
Commit
cb69ee19
authored
7 years ago
by
Harris Hancock
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ..-collapsing bug in relative URL parser
parent
699d285b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletion
+4
-1
url-test.c++
c++/src/kj/compat/url-test.c++
+3
-0
url.c++
c++/src/kj/compat/url.c++
+1
-1
No files found.
c++/src/kj/compat/url-test.c++
View file @
cb69ee19
...
@@ -369,6 +369,9 @@ KJ_TEST("parse relative URL") {
...
@@ -369,6 +369,9 @@ KJ_TEST("parse relative URL") {
parseAndCheckRelative
(
"https://capnproto.org/foo/bar?baz=qux#corge"
,
parseAndCheckRelative
(
"https://capnproto.org/foo/bar?baz=qux#corge"
,
"/http:/grault"
,
"/http:/grault"
,
"https://capnproto.org/http%3A/grault"
);
"https://capnproto.org/http%3A/grault"
);
parseAndCheckRelative
(
"https://capnproto.org/"
,
"/foo/../bar"
,
"https://capnproto.org/bar"
);
}
}
KJ_TEST
(
"parse relative URL failure"
)
{
KJ_TEST
(
"parse relative URL failure"
)
{
...
...
This diff is collapsed.
Click to expand it.
c++/src/kj/compat/url.c++
View file @
cb69ee19
...
@@ -312,7 +312,7 @@ Maybe<Url> Url::tryParseRelative(StringPtr text) const {
...
@@ -312,7 +312,7 @@ Maybe<Url> Url::tryParseRelative(StringPtr text) const {
for
(;;)
{
for
(;;)
{
auto
part
=
split
(
text
,
END_PATH_PART
);
auto
part
=
split
(
text
,
END_PATH_PART
);
if
(
part
.
size
()
==
2
&&
part
[
0
]
==
'.'
&&
part
[
1
]
==
'.'
)
{
if
(
part
.
size
()
==
2
&&
part
[
0
]
==
'.'
&&
part
[
1
]
==
'.'
)
{
if
(
path
.
size
()
!=
0
)
{
if
(
result
.
path
.
size
()
!=
0
)
{
result
.
path
.
removeLast
();
result
.
path
.
removeLast
();
}
}
result
.
hasTrailingSlash
=
true
;
result
.
hasTrailingSlash
=
true
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment