From 56976898bdf2b73581d23704a3b36f0bf2f45914 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Fri, 12 Jul 2019 12:23:13 +0900 Subject: [PATCH] Fix error 414 --- BTCPayServer/Hosting/Startup.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/BTCPayServer/Hosting/Startup.cs b/BTCPayServer/Hosting/Startup.cs index 74b7e2244..22566ac59 100644 --- a/BTCPayServer/Hosting/Startup.cs +++ b/BTCPayServer/Hosting/Startup.cs @@ -95,6 +95,10 @@ namespace BTCPayServer.Hosting string httpsCertificateFilePath = Configuration.GetOrDefault("HttpsCertificateFilePath", null); bool useDefaultCertificate = Configuration.GetOrDefault("HttpsUseDefaultCertificate", false); bool hasCertPath = !String.IsNullOrEmpty(httpsCertificateFilePath); + services.Configure(kestrel => + { + kestrel.Limits.MaxRequestLineSize = 8_192 * 10 * 5; // Around 500K, transactions passed in URI should not be bigger than this + }); if (hasCertPath || useDefaultCertificate) { var bindAddress = Configuration.GetOrDefault("bind", IPAddress.Any); @@ -102,7 +106,6 @@ namespace BTCPayServer.Hosting services.Configure(kestrel => { - kestrel.Limits.MaxRequestLineSize = 8_192 * 10 * 5; // Around 500K, transactions passed in URI should not be bigger than this if (hasCertPath && !File.Exists(httpsCertificateFilePath)) { // Note that by design this is a fatal error condition that will cause the process to exit.