Skip to content

Commit

Permalink
PC-1122: Updated header dictionary adding to new method (headers.append)
Browse files Browse the repository at this point in the history
  • Loading branch information
Glenn-Clarke committed Jun 24, 2024
1 parent c4679a5 commit 8370288
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion SeaPublicWebsite/Middleware/BasicAuthMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ private static void AddOrUpdateHeader(HttpContext httpContext, string headerName
}
else
{
httpContext.Response.Headers.Add(headerName, headerValue);
httpContext.Response.Headers.Append(headerName, headerValue);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions SeaPublicWebsite/Middleware/SecurityHeadersMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ public Task Invoke(HttpContext context)
{
if (!context.Response.Headers.ContainsKey("X-Content-Type-Options"))
{
context.Response.Headers.Add("X-Content-Type-Options", "nosniff");
context.Response.Headers.Append("X-Content-Type-Options", "nosniff");
}

if (!context.Response.Headers.ContainsKey("Content-Security-Policy"))
{
context.Response.Headers.Add("Content-Security-Policy",
context.Response.Headers.Append("Content-Security-Policy",
"default-src 'self'; script-src * 'unsafe-inline' 'unsafe-eval'; connect-src * 'unsafe-inline'");

}

if (!context.Response.Headers.ContainsKey("Referrer-Policy"))
{
context.Response.Headers.Add("Referrer-Policy", "no-referrer");
context.Response.Headers.Append("Referrer-Policy", "no-referrer");

}

Expand Down

0 comments on commit 8370288

Please sign in to comment.