From c77fa986403cee7c383df41490d173bb293b9c9a Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 1 Sep 2021 15:51:18 +0100 Subject: [PATCH] make MAXCONTENTLENGHT a constant --- .../Framework/Servers/HttpServer/OSHttpServer/HttpRequest.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OpenSim/Framework/Servers/HttpServer/OSHttpServer/HttpRequest.cs b/OpenSim/Framework/Servers/HttpServer/OSHttpServer/HttpRequest.cs index cfc886c4b7..cfd60debeb 100644 --- a/OpenSim/Framework/Servers/HttpServer/OSHttpServer/HttpRequest.cs +++ b/OpenSim/Framework/Servers/HttpServer/OSHttpServer/HttpRequest.cs @@ -14,6 +14,7 @@ namespace OSHttpServer /// public class HttpRequest : IHttpRequest { + private const int MAXCONTENTLENGHT = 250 * 1024 * 1024; /// /// Chars used to split an URL path into multiple parts. /// @@ -340,10 +341,10 @@ namespace OSHttpServer case "content-length": if (!int.TryParse(value, out int t)) throw new BadRequestException("Invalid content length."); - if (t > 250 * 1024 * 1024) + if (t > MAXCONTENTLENGHT) throw new OSHttpServer.Exceptions.HttpException(HttpStatusCode.RequestEntityTooLarge,"Request Entity Too Large"); ContentLength = t; - break; //todo: maybe throw an exception + break; case "host": try {