Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Pass Uri.IdnHost to WinHttpConnect #28849

Merged
merged 13 commits into from
Apr 17, 2018
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ private async void StartRequest(WinHttpRequestState state)
// Specify an HTTP server.
connectHandle = Interop.WinHttp.WinHttpConnect(
_sessionHandle,
state.RequestMessage.RequestUri.Host,
state.RequestMessage.RequestUri.HostNameType == UriHostNameType.IPv6 ? $"[{state.RequestMessage.RequestUri.IdnHost}]" : state.RequestMessage.RequestUri.IdnHost,
Copy link
Member Author

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.

Copy link
Member Author

@MarcoRossignoli MarcoRossignoli Apr 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davidsh @rmkerr @Caesar1995 without [] ipv6 http://[::1234]:8080 and http://[::1234] tests fails with ERROR_INTERNET_INVALID_URL.

Copy link
Member Author

@MarcoRossignoli MarcoRossignoli Apr 6, 2018

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.

Copy link
Contributor

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.

(ushort)state.RequestMessage.RequestUri.Port,
0);
ThrowOnInvalidHandle(connectHandle, nameof(Interop.WinHttp.WinHttpConnect));
Expand Down