Skip to content
Draft
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
7 changes: 7 additions & 0 deletions TestsCommon/Helpers/HttpServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,19 @@ private async Task ProxyTo(
if (string.Equals(headerName, "Connection", StringComparison.OrdinalIgnoreCase)) continue;
if (string.Equals(headerName, "Keep-Alive", StringComparison.OrdinalIgnoreCase)) continue;
if (string.Equals(headerName, "Transfer-Encoding", StringComparison.OrdinalIgnoreCase)) continue;
if (string.Equals(headerName, "Accept-Encoding", StringComparison.OrdinalIgnoreCase)) continue;

var values = req.Headers.GetValues(headerName);
if (values == null) continue;
outgoing.Headers.TryAddWithoutValidation(headerName, values);
}

// The answer is copied back to the page unchanged, and a Brotli
// answer copied to a page on plain HTTP leaves the page's script
// undefined. "identity" asks for no compression, which leaving
// the header out would not (RFC 9110 section 12.5.3).
outgoing.Headers.TryAddWithoutValidation("Accept-Encoding", "identity");

if (req.HasEntityBody)
{
var ms = new MemoryStream();
Expand Down
Loading