return a proper http error
parent
144f353d50
commit
7b2b29d10d
|
@ -1390,7 +1390,6 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
}
|
||||
}
|
||||
|
||||
response.KeepAlive = true;
|
||||
string responseData = string.Empty;
|
||||
|
||||
responseData = jsonRpcResponse.Serialize();
|
||||
|
@ -1402,6 +1401,8 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
private byte[] HandleLLSDRequests(OSHttpRequest request, OSHttpResponse response)
|
||||
{
|
||||
//m_log.Warn("[BASE HTTP SERVER]: We've figured out it's a LLSD Request");
|
||||
bool notfound = false;
|
||||
|
||||
Stream requestStream = request.InputStream;
|
||||
|
||||
string requestBody;
|
||||
|
@ -1452,13 +1453,20 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
else
|
||||
{
|
||||
// Oops, no handler for this.. give em the failed message
|
||||
llsdResponse = GenerateNoLLSDHandlerResponse();
|
||||
notfound = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
llsdResponse = GenerateNoLLSDHandlerResponse();
|
||||
notfound = true;
|
||||
}
|
||||
|
||||
if(notfound)
|
||||
{
|
||||
response.StatusCode = (int)HttpStatusCode.NotFound;
|
||||
response.StatusDescription = "Not found";
|
||||
return null;
|
||||
}
|
||||
|
||||
byte[] buffer = new byte[0];
|
||||
|
@ -1479,7 +1487,6 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
|
||||
response.ContentLength64 = buffer.Length;
|
||||
response.ContentEncoding = Encoding.UTF8;
|
||||
response.KeepAlive = true;
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
@ -1684,15 +1691,6 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
}
|
||||
}
|
||||
|
||||
private OSDMap GenerateNoLLSDHandlerResponse()
|
||||
{
|
||||
OSDMap map = new OSDMap();
|
||||
map["reason"] = OSD.FromString("LLSDRequest");
|
||||
map["message"] = OSD.FromString("No handler registered for LLSD Requests");
|
||||
map["login"] = OSD.FromString("false");
|
||||
return map;
|
||||
}
|
||||
|
||||
public byte[] HandleHTTPRequest(OSHttpRequest request, OSHttpResponse response)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
|
|
Loading…
Reference in New Issue