-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Pass Uri.IdnHost to WinHttpConnect #28849
Changes from 8 commits
4f1a60d
8a9cbee
c5e4fdc
9009d2b
940f497
caed777
3f21a59
99648b0
9c80ffe
91ba27d
850743d
b3cdff8
6973787
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 |
---|---|---|
|
@@ -2138,6 +2138,25 @@ await server.AcceptConnectionSendCustomResponseAndCloseAsync( | |
}); | ||
} | ||
|
||
[OuterLoop] | ||
[Fact] | ||
public async Task GetAsync_IdnHostName() | ||
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. Usually the naming for the test function should be like: A_B_C, A is the attribute what we are testing about, B is the condition to trigger the attribute, and C is the behavior outcome. You can change to something like 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. done |
||
{ | ||
HttpClientHandler handler = CreateHttpClientHandler(); | ||
using (var client = new HttpClient(handler)) | ||
{ | ||
/* | ||
international version of the Starbucks website | ||
Punnycode: xn--oy2b35ckwhba574atvuzkc.com | ||
*/ | ||
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. In corefx, we usually do comment like this: // Here is the comment. 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. done |
||
string idn = "\uc2a4\ud0c0\ubc85\uc2a4\ucf54\ub9ac\uc544.com"; | ||
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. I would name this variable to something like "server". "idn" implies that this string consists of punnycode character which it doesn't. It is simply a hostname of a endpoint that just happens to have Unicode characters in the name. And I would simplify this by bringing in the "http://" portion of the string here as well, i.e. string server = "http://\uc2a4\ud0c0\ubc85\uc2a4\ucf54\ub9ac\uc544.com"; |
||
using (HttpResponseMessage response = await client.GetAsync("http://" + idn)) | ||
{ | ||
response.EnsureSuccessStatusCode(); | ||
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. @davidsh i added response.EnsureSuccessStatusCode(); as assertion. 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. Explained in one of the comments above. |
||
} | ||
} | ||
} | ||
|
||
#region Post Methods Tests | ||
|
||
[OuterLoop] // TODO: Issue #11345 | ||
|
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.
With regard to this i'm writing a manual test.
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.
@davidsh @rmkerr @Caesar1995 without
[]
ipv6http://[::1234]:8080
andhttp://[::1234]
tests fails withERROR_INTERNET_INVALID_URL
.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.
@Caesar1995 related to https://github.com/dotnet/corefx/issues/28863#issue-311719169 if this PR will be merged i think we'll need to remove workaround also here.
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.
Yes, thanks for bringing this up! I will update that issue with this PR.