From 18a24ddc57674a6280601f1334673943bbfcd93b Mon Sep 17 00:00:00 2001 From: Daniel Murrmann <9040811+fancyDevelopment@users.noreply.github.com> Date: Tue, 9 Sep 2025 10:58:53 +0200 Subject: [PATCH 1/2] Using standard header to check for an api call --- .../Authentication/GatewayAuthentication.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Fancy.ResourceLinker.Gateway/Authentication/GatewayAuthentication.cs b/src/Fancy.ResourceLinker.Gateway/Authentication/GatewayAuthentication.cs index c969771..5d05305 100644 --- a/src/Fancy.ResourceLinker.Gateway/Authentication/GatewayAuthentication.cs +++ b/src/Fancy.ResourceLinker.Gateway/Authentication/GatewayAuthentication.cs @@ -137,7 +137,7 @@ internal static void AddGatewayAuthentication(IServiceCollection services, Gatew logger.LogInformation("Starting authorization flow for request to: " + context.HttpContext.Request.GetDisplayUrl()); // If the request was made 'from Code aka from javascript' return unauthorized instead of the default redirect // to make visible to a javascript that the authentication is not valid (anymore) - if(context.Request.Headers["X-Requested-With"] == "XmlHttpRequest") + if(context.Request.Headers["X-Requested-With"] == "XmlHttpRequest" || context.Request.Headers["Sec-Fetch-Dest"] == "empty") { context.Response.StatusCode = StatusCodes.Status401Unauthorized; context.HandleResponse(); From a4321284452d3aec1f7b236e42d1189aa8c10667 Mon Sep 17 00:00:00 2001 From: Daniel Murrmann <9040811+fancyDevelopment@users.noreply.github.com> Date: Tue, 9 Sep 2025 11:00:08 +0200 Subject: [PATCH 2/2] Updated version --- .../Fancy.ResourceLinker.Gateway.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Fancy.ResourceLinker.Gateway/Fancy.ResourceLinker.Gateway.csproj b/src/Fancy.ResourceLinker.Gateway/Fancy.ResourceLinker.Gateway.csproj index c63971f..117e1b8 100644 --- a/src/Fancy.ResourceLinker.Gateway/Fancy.ResourceLinker.Gateway.csproj +++ b/src/Fancy.ResourceLinker.Gateway/Fancy.ResourceLinker.Gateway.csproj @@ -1,7 +1,7 @@  - 1.1.0-beta.2 + 1.1.0-beta.3 net8.0 enable enable