From 7f2cfe734bc18a217390cdfc47248c4658d889cf Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 25 Apr 2020 14:10:59 +0100 Subject: [PATCH] null uri path is already checked at low level --- OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index afe4b1e109..e0fbea2090 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -622,7 +622,7 @@ namespace OpenSim.Framework.Servers.HttpServer // } // } string path = request.UriPath; - if (!string.IsNullOrWhiteSpace(path) && path!="/" && TryGetSimpleStreamHandler(path, out ISimpleStreamHandler hdr)) + if (path!="/" && TryGetSimpleStreamHandler(path, out ISimpleStreamHandler hdr)) { hdr.Handle(request, response); if (request.InputStream != null && request.InputStream.CanRead) @@ -1948,9 +1948,8 @@ namespace OpenSim.Framework.Servers.HttpServer public byte[] SendHTML404(OSHttpResponse response, string host) { - // I know this statuscode is dumb, but the client doesn't respond to 404s and 500s response.StatusCode = 404; - response.AddHeader("Content-type", "text/html"); + response.ContentType = "text/html"; string responseString = GetHTTP404(host); byte[] buffer = Encoding.UTF8.GetBytes(responseString);