diff options
author | Rory& <root@rory.gay> | 2024-02-28 21:39:51 +0100 |
---|---|---|
committer | Rory& <root@rory.gay> | 2024-02-28 21:39:51 +0100 |
commit | a574addfe09acf3f53fc58a7226d6e10a41d5c4d (patch) | |
tree | d80a379bf8b0491b0c27b9d006202beb8d716877 /MatrixMediaGate/Program.cs | |
parent | Fix bug with URL encoding (diff) | |
download | MatrixMediaGate-a574addfe09acf3f53fc58a7226d6e10a41d5c4d.tar.xz |
Alternate media type handling
Diffstat (limited to 'MatrixMediaGate/Program.cs')
-rw-r--r-- | MatrixMediaGate/Program.cs | 3 |
1 files changed, 2 insertions, 1 deletions
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; } |