null uri path is already checked at low level

master
UbitUmarov 2020-04-25 14:10:59 +01:00
parent eae9928961
commit 7f2cfe734b
1 changed files with 2 additions and 3 deletions

View File

@ -622,7 +622,7 @@ namespace OpenSim.Framework.Servers.HttpServer
// } // }
// } // }
string path = request.UriPath; 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); hdr.Handle(request, response);
if (request.InputStream != null && request.InputStream.CanRead) if (request.InputStream != null && request.InputStream.CanRead)
@ -1948,9 +1948,8 @@ namespace OpenSim.Framework.Servers.HttpServer
public byte[] SendHTML404(OSHttpResponse response, string host) 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.StatusCode = 404;
response.AddHeader("Content-type", "text/html"); response.ContentType = "text/html";
string responseString = GetHTTP404(host); string responseString = GetHTTP404(host);
byte[] buffer = Encoding.UTF8.GetBytes(responseString); byte[] buffer = Encoding.UTF8.GetBytes(responseString);