-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http, utility: Fix unicode URL parsing #12324
Changes from 1 commit
94a5779
2279973
ef5ae8b
05ae4e6
2cf0f11
5e59876
20e6da1
22c8b03
d35475d
4aafd73
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- source/icudefs.mk.in | ||
+++ source/icudefs.mk.in | ||
@@ -117,7 +117,7 @@ | ||
CC = @CC@ | ||
CXX = @CXX@ | ||
AR = @AR@ | ||
-ARFLAGS = @ARFLAGS@ r | ||
+ARFLAGS = @ARFLAGS@ | ||
RANLIB = @RANLIB@ | ||
COMPILE_LINK_ENVVAR = @COMPILE_LINK_ENVVAR@ | ||
UCLN_NO_AUTO_CLEANUP = @UCLN_NO_AUTO_CLEANUP@ | ||
|
||
--- source/config/mh-darwin | ||
+++ source/config/mh-darwin | ||
@@ -22,1 +22,1 @@ | ||
-ARFLAGS += -c | ||
+ARFLAGS += -crs |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1289,6 +1289,12 @@ TEST(Url, ParsingTest) { | |
// Test url with non-default ports. | ||
validateUrl("https://www.host.com:8443", "https", "www.host.com:8443", "/", 8443); | ||
validateUrl("http://www.host.com:8080", "http", "www.host.com:8080", "/", 8080); | ||
|
||
#if !defined(__APPLE__) && !defined(WIN32) | ||
// TODO(dio): Fix the unicode data (static) linking for macOS and Windows. | ||
// Make sure we can parse unicode URL. | ||
validateUrl("https://\xe5\x85\x89.example/", "https", "xn--54q.example", "/", 443); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So what was the prior behavior? Would all unicode URLs be deemed invalid? If so I think this merits guarding in case upstreams can't handle unicode and the change in Envoy validation causes problems. If some unicode URLS passed through previously maybe it doesn't make enough difference to merit the guard. WDYT? Either way probably worth a release note. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Unicode host name segments of URI's are invalid, at the transport level. Unicode -> PunyCode. The resulting URI is a valid hostname by the DNS spec. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dio In what circumstances we would get unicode URL in non-punycode format? I'm confused why we need handling that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry for the confusion. This is motivated by porting the test case from https://quiche.googlesource.com/googleurl/+/refs/heads/master/test/basic_test.cc#31. I think It is possible if we want to process input from config or logging. However, if this is not a valid use case. I can skip checking for this one. |
||
#endif | ||
} | ||
|
||
void validateConnectUrl(absl::string_view raw_url, absl::string_view expected_host_port, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will update this when we have an agreement on how we do snapshot for googleurl release.