Skip to content

Commit 74e9ce5

Browse files
Using standard header to check for an api call (#54)
1 parent 1e2ad8c commit 74e9ce5

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/Fancy.ResourceLinker.Gateway/Authentication/GatewayAuthentication.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ internal static void AddGatewayAuthentication(IServiceCollection services, Gatew
137137
logger.LogInformation("Starting authorization flow for request to: " + context.HttpContext.Request.GetDisplayUrl());
138138
// If the request was made 'from Code aka from javascript' return unauthorized instead of the default redirect
139139
// to make visible to a javascript that the authentication is not valid (anymore)
140-
if(context.Request.Headers["X-Requested-With"] == "XmlHttpRequest")
140+
if(context.Request.Headers["X-Requested-With"] == "XmlHttpRequest" || context.Request.Headers["Sec-Fetch-Dest"] == "empty")
141141
{
142142
context.Response.StatusCode = StatusCodes.Status401Unauthorized;
143143
context.HandleResponse();

‎src/Fancy.ResourceLinker.Gateway/Fancy.ResourceLinker.Gateway.csproj‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<Version>1.1.0-beta.2</Version>
4+
<Version>1.1.0-beta.3</Version>
55
<TargetFramework>net8.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>

0 commit comments

Comments
 (0)