From db40c7bc32daa2c13f9f95beb932ed3dc146ea16 Mon Sep 17 00:00:00 2001 From: GameXG Date: Thu, 11 Oct 2018 22:50:28 +0800 Subject: [PATCH] Solving the new version of btcpayserver caused btcpay-python not to create an order problem (#327) --- BTCPayServer/Hosting/BTCpayMiddleware.cs | 6 +++--- BTCPayServer/Security/BitpayAuthentication.cs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/BTCPayServer/Hosting/BTCpayMiddleware.cs b/BTCPayServer/Hosting/BTCpayMiddleware.cs index 4aa3f6b1d..28fd44b60 100644 --- a/BTCPayServer/Hosting/BTCpayMiddleware.cs +++ b/BTCPayServer/Hosting/BTCpayMiddleware.cs @@ -83,14 +83,14 @@ namespace BTCPayServer.Hosting var path = httpContext.Request.Path.Value; if ( bitpayAuth && - path == "/invoices" && + (path == "/invoices" || path == "/invoices/") && httpContext.Request.Method == "POST" && isJson) return true; if ( bitpayAuth && - path == "/invoices" && + (path == "/invoices" || path == "/invoices/") && httpContext.Request.Method == "GET") return true; @@ -106,7 +106,7 @@ namespace BTCPayServer.Hosting if ( path.Equals("/tokens", StringComparison.Ordinal) && - ( httpContext.Request.Method == "GET" || httpContext.Request.Method == "POST")) + (httpContext.Request.Method == "GET" || httpContext.Request.Method == "POST")) return true; return false; diff --git a/BTCPayServer/Security/BitpayAuthentication.cs b/BTCPayServer/Security/BitpayAuthentication.cs index 2fac207ad..beb769a66 100644 --- a/BTCPayServer/Security/BitpayAuthentication.cs +++ b/BTCPayServer/Security/BitpayAuthentication.cs @@ -210,14 +210,14 @@ namespace BTCPayServer.Security var path = httpContext.Request.Path.Value; if ( bitpayAuth && - path == "/invoices" && + (path == "/invoices" || path == "/invoices/") && httpContext.Request.Method == "POST" && isJson) return true; if ( bitpayAuth && - path == "/invoices" && + (path == "/invoices" || path == "/invoices/") && httpContext.Request.Method == "GET") return true;