about summary refs log tree commit diff
path: root/MatrixMediaGate/Program.cs
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-02-26 19:05:17 +0100
committerRory& <root@rory.gay>2024-02-26 19:05:17 +0100
commit48673554212b5f6ff8a6a069d285820eba02f4b8 (patch)
treea0a310bc37c20bf4c085be3b0bd0761ca64defad /MatrixMediaGate/Program.cs
parentOptimise hot paths (diff)
downloadMatrixMediaGate-48673554212b5f6ff8a6a069d285820eba02f4b8.tar.xz
Log request headers.
Diffstat (limited to 'MatrixMediaGate/Program.cs')
-rw-r--r--MatrixMediaGate/Program.cs5
1 files changed, 3 insertions, 2 deletions
diff --git a/MatrixMediaGate/Program.cs b/MatrixMediaGate/Program.cs

index 4a62ebc..ee06b9a 100644 --- a/MatrixMediaGate/Program.cs +++ b/MatrixMediaGate/Program.cs
@@ -68,8 +68,9 @@ async Task ProxyMaybeAuth(HttpClient hc, ProxyConfiguration cfg, AuthValidator a } async Task ProxyMedia(string serverName, ProxyConfiguration cfg, HttpClient hc, AuthValidator auth, HttpContext ctx, ILogger<Program> logger) { - if (cfg.TrustedServers.Contains(serverName) || auth.ValidateAuth(ctx)) { - await ProxyMaybeAuth(hc, cfg, auth, ctx, logger); // Some clients may send Authorization header... + // Some clients may send Authorization header, so we handle this last... + if (cfg.TrustedServers.Contains(serverName) || auth.ValidateAuth(ctx) || await auth.UpdateAuth(ctx)) { + await Proxy(hc, cfg, ctx, logger); } else { ctx.Response.StatusCode = 403;