From 62adbbe75226de8cb14c3f468ad0dff1da91a702 Mon Sep 17 00:00:00 2001 From: Rory& Date: Wed, 28 Feb 2024 22:03:13 +0100 Subject: Alternate header handling for request headers --- MatrixMediaGate/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'MatrixMediaGate/Program.cs') diff --git a/MatrixMediaGate/Program.cs b/MatrixMediaGate/Program.cs index 353858b..cef146f 100644 --- a/MatrixMediaGate/Program.cs +++ b/MatrixMediaGate/Program.cs @@ -27,7 +27,7 @@ async Task Proxy(HttpClient hc, ProxyConfiguration cfg, HttpContext ctx, ILogger using var req = new HttpRequestMessage(method, path); foreach (var header in ctx.Request.Headers) { if (header.Key != "Accept-Encoding" && header.Key != "Content-Type" && header.Key != "Content-Length") - req.Headers.Add(header.Key, header.Value.ToArray()); + req.Headers.TryAddWithoutValidation(header.Key, header.Value.ToArray()); } req.Headers.Host = cfg.Host; -- cgit 1.5.1