fix http version

master
UbitUmarov 2020-04-22 00:00:24 +01:00
parent 6b6baa9e51
commit 212c25f906
3 changed files with 3 additions and 5 deletions

View File

@ -1256,7 +1256,6 @@ namespace OpenSim.Framework.Servers.HttpServer
response.ContentType = "text/plain"; response.ContentType = "text/plain";
response.StatusCode = 404; response.StatusCode = 404;
response.StatusDescription = "Not Found"; response.StatusDescription = "Not Found";
response.ProtocolVersion = "HTTP/1.0";
responseString = "Not found"; responseString = "Not found";
response.KeepAlive = false; response.KeepAlive = false;
@ -1431,7 +1430,6 @@ namespace OpenSim.Framework.Servers.HttpServer
response.ContentType = "text/plain"; response.ContentType = "text/plain";
response.StatusCode = 404; response.StatusCode = 404;
response.StatusDescription = "Not Found"; response.StatusDescription = "Not Found";
response.ProtocolVersion = "HTTP/1.0";
buffer = Encoding.UTF8.GetBytes("Not found"); buffer = Encoding.UTF8.GetBytes("Not found");
} }
else else

View File

@ -396,7 +396,7 @@ namespace OSHttpServer
LogWriter.Write(this, LogPrio.Warning, "Bad request, responding with it. Error: " + err); LogWriter.Write(this, LogPrio.Warning, "Bad request, responding with it. Error: " + err);
try try
{ {
Respond("HTTP/1.0", HttpStatusCode.BadRequest, err.Message); Respond("HTTP/1.1", HttpStatusCode.BadRequest, err.Message);
} }
catch (Exception err2) catch (Exception err2)
{ {

View File

@ -39,7 +39,7 @@ namespace OSHttpServer
{ {
m_httpVersion = request.HttpVersion; m_httpVersion = request.HttpVersion;
if (string.IsNullOrEmpty(m_httpVersion)) if (string.IsNullOrEmpty(m_httpVersion))
m_httpVersion = "HTTP/1.0"; m_httpVersion = "HTTP/1.1";
Status = HttpStatusCode.OK; Status = HttpStatusCode.OK;
m_context = context; m_context = context;
@ -222,7 +222,7 @@ namespace OSHttpServer
var sb = new StringBuilder(); var sb = new StringBuilder();
if(string.IsNullOrWhiteSpace(m_httpVersion)) if(string.IsNullOrWhiteSpace(m_httpVersion))
sb.AppendFormat("HTTP1/0 {0} {1}\r\n", (int)Status, sb.AppendFormat("HTTP/1.1 {0} {1}\r\n", (int)Status,
string.IsNullOrEmpty(Reason) ? Status.ToString() : Reason); string.IsNullOrEmpty(Reason) ? Status.ToString() : Reason);
else else
sb.AppendFormat("{0} {1} {2}\r\n", m_httpVersion, (int)Status, sb.AppendFormat("{0} {1} {2}\r\n", m_httpVersion, (int)Status,