No need of authentication for GetInvoice API (#166)

This commit is contained in:
nicolas.dorier
2018-05-11 17:05:08 +09:00
parent a3c46c8f67
commit 199db01eaf
3 changed files with 6 additions and 4 deletions

View File

@@ -45,7 +45,7 @@ namespace BTCPayServer.Controllers
[Route("invoices/{id}")]
public async Task<DataWrapper<InvoiceResponse>> 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);

View File

@@ -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);
}

View File

@@ -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) &&