mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-02-23 07:04:26 +01:00
Correctly set Access-Control-Allow-Headers
This commit is contained in:
@@ -42,8 +42,10 @@ namespace BTCPayServer.Hosting
|
||||
{
|
||||
httpContext.Response.StatusCode = 200;
|
||||
httpContext.Response.SetHeader("Access-Control-Allow-Origin", "*");
|
||||
httpContext.Response.SetHeader("Access-Control-Allow-Headers", "*");
|
||||
httpContext.Response.SetHeader("Access-Control-Allow-Methods", "*");
|
||||
if (httpContext.Request.Headers.ContainsKey("Access-Control-Request-Headers"))
|
||||
{
|
||||
httpContext.Response.SetHeader("Access-Control-Allow-Headers", httpContext.Request.Headers["Access-Control-Request-Headers"].FirstOrDefault());
|
||||
}
|
||||
return; // We bypass MVC completely
|
||||
}
|
||||
httpContext.SetIsBitpayAPI(isBitpayAPI);
|
||||
|
||||
Reference in New Issue
Block a user