From 6dbc844462b3ea8e1b553eadb9e51de8b263826a Mon Sep 17 00:00:00 2001 From: exyi Date: Sat, 3 Oct 2020 22:18:24 +0000 Subject: [PATCH] Proxy fix to enable API usage --- server/Ksp.WebServer/Startup.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server/Ksp.WebServer/Startup.cs b/server/Ksp.WebServer/Startup.cs index e1e8615..169650d 100644 --- a/server/Ksp.WebServer/Startup.cs +++ b/server/Ksp.WebServer/Startup.cs @@ -82,8 +82,11 @@ namespace Ksp.WebServer opt.WithHttpClientName("RedirectClient"); opt.WithBeforeSend((cx, request) => { - request.Headers.Authorization = - new AuthenticationHeaderValue("Basic", "SECRET"); + if (request.Headers.Authorization is null) + { + request.Headers.Authorization = + new AuthenticationHeaderValue("Basic", "SECRET"); + } if (request.Headers.Referrer is object) request.Headers.Referrer = new UriBuilder(request.Headers.Referrer) {