From c84c0ac64db08e6478c58eaa7fd87c86a4c45bca Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Sat, 2 Feb 2019 15:22:00 +0900 Subject: [PATCH] set CORS headers --- BTCPayServer/Hosting/BTCpayMiddleware.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/BTCPayServer/Hosting/BTCpayMiddleware.cs b/BTCPayServer/Hosting/BTCpayMiddleware.cs index 40639866d..063809a7a 100644 --- a/BTCPayServer/Hosting/BTCpayMiddleware.cs +++ b/BTCPayServer/Hosting/BTCpayMiddleware.cs @@ -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);