mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-01-19 05:33:31 +01:00
Fix build
This commit is contained in:
parent
8d0d80e086
commit
aaa05eb5ec
@ -61,7 +61,6 @@ namespace BTCPayServer.Hosting
|
|||||||
public static IServiceCollection AddBTCPayServer(this IServiceCollection services, IConfiguration configuration)
|
public static IServiceCollection AddBTCPayServer(this IServiceCollection services, IConfiguration configuration)
|
||||||
{
|
{
|
||||||
#if NETCOREAPP21
|
#if NETCOREAPP21
|
||||||
services.AddSingleton<IConfigureOptions<MvcJsonOptions>, MVCConfigureOptions>();
|
|
||||||
services.AddSingleton<MvcNewtonsoftJsonOptions>();
|
services.AddSingleton<MvcNewtonsoftJsonOptions>();
|
||||||
#else
|
#else
|
||||||
services.AddSingleton<MvcNewtonsoftJsonOptions>(o => o.GetRequiredService<IOptions<MvcNewtonsoftJsonOptions>>().Value);
|
services.AddSingleton<MvcNewtonsoftJsonOptions>(o => o.GetRequiredService<IOptions<MvcNewtonsoftJsonOptions>>().Value);
|
||||||
@ -334,14 +333,4 @@ namespace BTCPayServer.Hosting
|
|||||||
return app;
|
return app;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NETCOREAPP21
|
|
||||||
class MVCConfigureOptions : IConfigureOptions<MvcJsonOptions>
|
|
||||||
{
|
|
||||||
public void Configure(MvcJsonOptions options)
|
|
||||||
{
|
|
||||||
new NBXplorer.Serializer(null).ConfigureSerializer(options.SerializerSettings);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
@ -21,8 +21,6 @@ using BTCPayServer.HostedServices;
|
|||||||
|
|
||||||
#if NETCOREAPP21
|
#if NETCOREAPP21
|
||||||
using IHostApplicationLifetime = Microsoft.AspNetCore.Hosting.IApplicationLifetime;
|
using IHostApplicationLifetime = Microsoft.AspNetCore.Hosting.IApplicationLifetime;
|
||||||
#else
|
|
||||||
using Microsoft.AspNetCore.Hosting;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace BTCPayServer.Payments.Bitcoin
|
namespace BTCPayServer.Payments.Bitcoin
|
||||||
|
@ -18,7 +18,7 @@ using NBitpayClient;
|
|||||||
using NBitpayClient.Extensions;
|
using NBitpayClient.Extensions;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using BTCPayServer.Logging;
|
using BTCPayServer.Logging;
|
||||||
using Microsoft.AspNetCore.Http.Internal;
|
|
||||||
using Microsoft.AspNetCore.Authentication;
|
using Microsoft.AspNetCore.Authentication;
|
||||||
using System.Text.Encodings.Web;
|
using System.Text.Encodings.Web;
|
||||||
using BTCPayServer.Data;
|
using BTCPayServer.Data;
|
||||||
@ -95,7 +95,7 @@ namespace BTCPayServer.Security.Bitpay
|
|||||||
|
|
||||||
private async Task<(string StoreId, bool SuccessAuth)> CheckBitId(HttpContext httpContext, string sig, string id, List<Claim> claims)
|
private async Task<(string StoreId, bool SuccessAuth)> CheckBitId(HttpContext httpContext, string sig, string id, List<Claim> claims)
|
||||||
{
|
{
|
||||||
httpContext.Request.EnableRewind();
|
httpContext.Request.EnableBuffering();
|
||||||
|
|
||||||
string storeId = null;
|
string storeId = null;
|
||||||
string body = string.Empty;
|
string body = string.Empty;
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Microsoft.AspNetCore.Hosting.Internal;
|
|
||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using Newtonsoft.Json.Serialization;
|
using Newtonsoft.Json.Serialization;
|
||||||
#if NETCOREAPP21
|
#if NETCOREAPP21
|
||||||
using IWebHostEnvironment = Microsoft.AspNetCore.Hosting.IHostingEnvironment;
|
using IWebHostEnvironment = Microsoft.AspNetCore.Hosting.IHostingEnvironment;
|
||||||
|
using Microsoft.AspNetCore.Hosting.Internal;
|
||||||
#else
|
#else
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
#endif
|
#endif
|
||||||
@ -34,7 +34,11 @@ namespace BTCPayServer.Services
|
|||||||
|
|
||||||
public LanguageService(IWebHostEnvironment environment)
|
public LanguageService(IWebHostEnvironment environment)
|
||||||
{
|
{
|
||||||
|
#if NETCOREAPP21
|
||||||
var path = (environment as HostingEnvironment)?.WebRootPath;
|
var path = (environment as HostingEnvironment)?.WebRootPath;
|
||||||
|
#else
|
||||||
|
var path = environment.WebRootPath;
|
||||||
|
#endif
|
||||||
if (string.IsNullOrEmpty(path))
|
if (string.IsNullOrEmpty(path))
|
||||||
{
|
{
|
||||||
//test environment
|
//test environment
|
||||||
|
Loading…
Reference in New Issue
Block a user