diff options
author | Oren Hurvitz | 2014-03-25 19:09:03 +0200 |
---|---|---|
committer | Oren Hurvitz | 2014-03-25 18:09:23 +0100 |
commit | 6d1d58b6549daea0183b70a1c702e3017abb9663 (patch) | |
tree | 3bd5ce0ff0f501dcccccc24915b7e00207563d47 /OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | |
parent | Use the "Content-Encoding" header to indicate gzipped streams (diff) | |
download | opensim-SC_OLD-6d1d58b6549daea0183b70a1c702e3017abb9663.zip opensim-SC_OLD-6d1d58b6549daea0183b70a1c702e3017abb9663.tar.gz opensim-SC_OLD-6d1d58b6549daea0183b70a1c702e3017abb9663.tar.bz2 opensim-SC_OLD-6d1d58b6549daea0183b70a1c702e3017abb9663.tar.xz |
Use the "X-Content-Encoding" header to indicate gzipped data, because old OpenSims fail if they get an unknown "Content-Encoding"
Diffstat (limited to 'OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs')
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 2f7b549..28324a5 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | |||
@@ -833,7 +833,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
833 | 833 | ||
834 | Stream inputStream = Util.Copy(request.InputStream); | 834 | Stream inputStream = Util.Copy(request.InputStream); |
835 | 835 | ||
836 | if (request.Headers["Content-Encoding"] == "gzip") | 836 | if ((request.Headers["Content-Encoding"] == "gzip") || (request.Headers["X-Content-Encoding"] == "gzip")) |
837 | inputStream = new GZipStream(inputStream, System.IO.Compression.CompressionMode.Decompress); | 837 | inputStream = new GZipStream(inputStream, System.IO.Compression.CompressionMode.Decompress); |
838 | 838 | ||
839 | using (StreamReader reader = new StreamReader(inputStream, Encoding.UTF8)) | 839 | using (StreamReader reader = new StreamReader(inputStream, Encoding.UTF8)) |
@@ -978,6 +978,9 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
978 | { | 978 | { |
979 | Stream requestStream = request.InputStream; | 979 | Stream requestStream = request.InputStream; |
980 | 980 | ||
981 | if ((request.Headers["Content-Encoding"] == "gzip") || (request.Headers["X-Content-Encoding"] == "gzip")) | ||
982 | requestStream = new GZipStream(requestStream, System.IO.Compression.CompressionMode.Decompress); | ||
983 | |||
981 | Encoding encoding = Encoding.UTF8; | 984 | Encoding encoding = Encoding.UTF8; |
982 | StreamReader reader = new StreamReader(requestStream, encoding); | 985 | StreamReader reader = new StreamReader(requestStream, encoding); |
983 | 986 | ||