From 48673554212b5f6ff8a6a069d285820eba02f4b8 Mon Sep 17 00:00:00 2001 From: Rory& Date: Mon, 26 Feb 2024 19:05:17 +0100 Subject: Log request headers. --- MatrixMediaGate/Program.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'MatrixMediaGate/Program.cs') 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 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; -- cgit 1.5.1