From a574addfe09acf3f53fc58a7226d6e10a41d5c4d Mon Sep 17 00:00:00 2001 From: Rory& Date: Wed, 28 Feb 2024 21:39:51 +0100 Subject: Alternate media type handling --- MatrixMediaGate/Program.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'MatrixMediaGate/Program.cs') diff --git a/MatrixMediaGate/Program.cs b/MatrixMediaGate/Program.cs index 658ef89..353858b 100644 --- a/MatrixMediaGate/Program.cs +++ b/MatrixMediaGate/Program.cs @@ -34,7 +34,8 @@ async Task Proxy(HttpClient hc, ProxyConfiguration cfg, HttpContext ctx, ILogger if (ctx.Request.ContentLength > 0) { req.Content = new StreamContent(ctx.Request.Body); - if (ctx.Request.ContentType != null) req.Content.Headers.ContentType = new MediaTypeHeaderValue(ctx.Request.ContentType); + if (ctx.Request.ContentType != null) req.Content.Headers.ContentType = MediaTypeHeaderValue.Parse(ctx.Request.ContentType); + if (ctx.Request.ContentLength != null) req.Content.Headers.ContentLength = ctx.Request.ContentLength; } -- cgit 1.5.1