about summary refs log tree commit diff
path: root/MatrixMediaGate/Program.cs
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-02-28 21:39:51 +0100
committerRory& <root@rory.gay>2024-02-28 21:39:51 +0100
commita574addfe09acf3f53fc58a7226d6e10a41d5c4d (patch)
treed80a379bf8b0491b0c27b9d006202beb8d716877 /MatrixMediaGate/Program.cs
parentFix bug with URL encoding (diff)
downloadMatrixMediaGate-a574addfe09acf3f53fc58a7226d6e10a41d5c4d.tar.xz
Alternate media type handling
Diffstat (limited to 'MatrixMediaGate/Program.cs')
-rw-r--r--MatrixMediaGate/Program.cs3
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;
     }