From 4c83ecd06afe66eeda61460d22e5539293a0bbf4 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Tue, 15 Jan 2019 14:03:12 +0900 Subject: [PATCH] Remove unused code --- BTCPayServer/Security/BitpayAuthentication.cs | 38 ------------------- 1 file changed, 38 deletions(-) diff --git a/BTCPayServer/Security/BitpayAuthentication.cs b/BTCPayServer/Security/BitpayAuthentication.cs index e71c9f2db..9ea5c6297 100644 --- a/BTCPayServer/Security/BitpayAuthentication.cs +++ b/BTCPayServer/Security/BitpayAuthentication.cs @@ -198,44 +198,6 @@ namespace BTCPayServer.Security } yield return token; } - - private bool IsBitpayAPI(HttpContext httpContext, bool bitpayAuth) - { - if (!httpContext.Request.Path.HasValue) - return false; - - var isJson = (httpContext.Request.ContentType ?? string.Empty).StartsWith("application/json", StringComparison.OrdinalIgnoreCase); - var path = httpContext.Request.Path.Value; - if ( - bitpayAuth && - (path == "/invoices" || path == "/invoices/") && - httpContext.Request.Method == "POST" && - isJson) - return true; - - if ( - bitpayAuth && - (path == "/invoices" || path == "/invoices/") && - httpContext.Request.Method == "GET") - return true; - - if ( - path.StartsWith("/invoices/", StringComparison.OrdinalIgnoreCase) && - httpContext.Request.Method == "GET" && - (isJson || httpContext.Request.Query.ContainsKey("token"))) - return true; - - if (path.Equals("/rates", StringComparison.OrdinalIgnoreCase) && - httpContext.Request.Method == "GET") - return true; - - if ( - path.Equals("/tokens", StringComparison.Ordinal) && - (httpContext.Request.Method == "GET" || httpContext.Request.Method == "POST")) - return true; - - return false; - } } internal static void AddAuthentication(IServiceCollection services, Action bitpayAuth = null) {