diff --git a/BTCPayServer/Controllers/InvoiceController.API.cs b/BTCPayServer/Controllers/InvoiceController.API.cs index 52b6f41f8..37dfcb85e 100644 --- a/BTCPayServer/Controllers/InvoiceController.API.cs +++ b/BTCPayServer/Controllers/InvoiceController.API.cs @@ -45,7 +45,7 @@ namespace BTCPayServer.Controllers [Route("invoices/{id}")] public async Task> GetInvoice(string id, string token) { - var invoice = await _InvoiceRepository.GetInvoice(HttpContext.GetStoreData().Id, id); + var invoice = await _InvoiceRepository.GetInvoice(null, id); if (invoice == null) throw new BitpayHttpException(404, "Object not found"); var resp = invoice.EntityToDTO(_NetworkProvider); diff --git a/BTCPayServer/Data/ApplicationDbContextFactory.cs b/BTCPayServer/Data/ApplicationDbContextFactory.cs index 88973dd30..8e6171d49 100644 --- a/BTCPayServer/Data/ApplicationDbContextFactory.cs +++ b/BTCPayServer/Data/ApplicationDbContextFactory.cs @@ -41,8 +41,10 @@ namespace BTCPayServer.Data public void ConfigureHangfireBuilder(IGlobalConfiguration builder) { + builder.UseMemoryStorage(); + //We always use memory storage because of incompatibilities with the latest postgres in 2.1 //if (_Type == DatabaseType.Sqlite) - builder.UseMemoryStorage(); //Sql provider does not support multiple workers + // builder.UseMemoryStorage(); //Sqlite provider does not support multiple workers //else if (_Type == DatabaseType.Postgres) // builder.UsePostgreSqlStorage(_ConnectionString); } diff --git a/BTCPayServer/Hosting/BTCpayMiddleware.cs b/BTCPayServer/Hosting/BTCpayMiddleware.cs index 2f229d12d..bb80f20aa 100644 --- a/BTCPayServer/Hosting/BTCpayMiddleware.cs +++ b/BTCPayServer/Hosting/BTCpayMiddleware.cs @@ -94,9 +94,9 @@ namespace BTCPayServer.Hosting return true; if ( - bitpayAuth && path.StartsWith("/invoices/", StringComparison.OrdinalIgnoreCase) && - httpContext.Request.Method == "GET") + httpContext.Request.Method == "GET" && + (httpContext.Request.ContentType ?? string.Empty).StartsWith("application/json", StringComparison.OrdinalIgnoreCase)) return true; if (path.Equals("/rates", StringComparison.OrdinalIgnoreCase) &&