mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 02:05:34 +08:00
Use the "Content-Encoding" header to indicate gzipped streams
This commit is contained in:
@@ -232,17 +232,16 @@ namespace OpenSim.Server.Handlers.Simulation
|
||||
httpResponse.KeepAlive = false;
|
||||
Encoding encoding = Encoding.UTF8;
|
||||
|
||||
Stream inputStream = null;
|
||||
if (httpRequest.ContentType == "application/x-gzip")
|
||||
inputStream = new GZipStream(request, CompressionMode.Decompress);
|
||||
else if (httpRequest.ContentType == "application/json")
|
||||
inputStream = request;
|
||||
else // no go
|
||||
if (httpRequest.ContentType != "application/json")
|
||||
{
|
||||
httpResponse.StatusCode = 406;
|
||||
return encoding.GetBytes("false");
|
||||
}
|
||||
|
||||
Stream inputStream = request;
|
||||
if (httpRequest.Headers["Content-Encoding"] == "gzip")
|
||||
inputStream = new GZipStream(inputStream, CompressionMode.Decompress);
|
||||
|
||||
StreamReader reader = new StreamReader(inputStream, encoding);
|
||||
|
||||
string requestBody = reader.ReadToEnd();
|
||||
@@ -433,11 +432,9 @@ namespace OpenSim.Server.Handlers.Simulation
|
||||
keysvals.Add("headers", headervals);
|
||||
keysvals.Add("querystringkeys", querystringkeys);
|
||||
|
||||
Stream inputStream;
|
||||
if (httpRequest.ContentType == "application/x-gzip")
|
||||
inputStream = new GZipStream(request, CompressionMode.Decompress);
|
||||
else
|
||||
inputStream = request;
|
||||
Stream inputStream = request;
|
||||
if (httpRequest.Headers["Content-Encoding"] == "gzip")
|
||||
inputStream = new GZipStream(inputStream, CompressionMode.Decompress);
|
||||
|
||||
Encoding encoding = Encoding.UTF8;
|
||||
StreamReader reader = new StreamReader(inputStream, encoding);
|
||||
|
||||
Reference in New Issue
Block a user