Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private async Task ReadPrefixAsync()
await _connectionStream.WriteAsync("HTTP/2.0 400 Bad Request\r\n\r\n"u8.ToArray());
_connectionSocket.Shutdown(SocketShutdown.Send);
// If WinHTTP doesn't support streaming a request without a length then it will fallback
// to HTTP/1.1. Throwing an exception to detect this case in WinHttpHandler tests.
// to HTTP/1.1. Throwing an exception to detect this case in WinHttpHandler tests.
throw new Exception("HTTP/1.1 request sent to HTTP/2 connection.");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1424,7 +1424,7 @@ private void WriteHeaders(HttpRequestMessage request, ref ArrayBuffer headerBuff
WriteIndexedHeader(H2StaticTable.MethodGet, normalizedMethod.Method, ref headerBuffer);
}

WriteIndexedHeader(_stream is SslStream ? H2StaticTable.SchemeHttps : H2StaticTable.SchemeHttp, ref headerBuffer);
WriteIndexedHeader(_pool.IsSecure ? H2StaticTable.SchemeHttps : H2StaticTable.SchemeHttp, ref headerBuffer);

if (request.HasHeaders && request.Headers.Host != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3193,7 +3193,12 @@ await LoopbackServerFactory.CreateClientAndServerAsync(
},
async server =>
{
await server.AcceptConnectionSendResponseAndCloseAsync(content: "foo");
HttpRequestData request = await server.AcceptConnectionSendResponseAndCloseAsync(content: "foo");
if (request.Version == HttpVersion20.Value)
{
HttpHeaderData schemeHeader = Assert.Single(request.Headers, headerData => headerData.Name == ":scheme");
Assert.Equal(useSsl ? "https" : "http", schemeHeader.Value);
}
}, options: options);
}

Expand Down