set CORS headers

This commit is contained in:
nicolas.dorier 2019-02-02 15:22:00 +09:00
parent 098e07988c
commit c84c0ac64d

View File

@ -41,6 +41,9 @@ namespace BTCPayServer.Hosting
if (isBitpayAPI && httpContext.Request.Method == "OPTIONS")
{
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", "*");
return; // We bypass MVC completely
}
httpContext.SetIsBitpayAPI(isBitpayAPI);