diff options
author | Oren Hurvitz | 2014-03-25 16:20:21 +0200 |
---|---|---|
committer | Oren Hurvitz | 2014-03-25 15:36:59 +0100 |
commit | b1d8aa0b6418a4edba8ce3b7b6f3db78616fd523 (patch) | |
tree | cddba93c37103619e422f1d6c062fcea03c24e22 /OpenSim/Framework/WebUtil.cs | |
parent | Use log-rolling on the log files (once per day) (diff) | |
download | opensim-SC-b1d8aa0b6418a4edba8ce3b7b6f3db78616fd523.zip opensim-SC-b1d8aa0b6418a4edba8ce3b7b6f3db78616fd523.tar.gz opensim-SC-b1d8aa0b6418a4edba8ce3b7b6f3db78616fd523.tar.bz2 opensim-SC-b1d8aa0b6418a4edba8ce3b7b6f3db78616fd523.tar.xz |
Use the "Content-Encoding" header to indicate gzipped streams
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/WebUtil.cs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index 10a2560..3972c06 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs | |||
@@ -250,9 +250,12 @@ namespace OpenSim.Framework | |||
250 | 250 | ||
251 | byte[] buffer = System.Text.Encoding.UTF8.GetBytes(strBuffer); | 251 | byte[] buffer = System.Text.Encoding.UTF8.GetBytes(strBuffer); |
252 | 252 | ||
253 | request.ContentType = "application/json"; | ||
254 | |||
253 | if (compressed) | 255 | if (compressed) |
254 | { | 256 | { |
255 | request.ContentType = "application/x-gzip"; | 257 | request.Headers["Content-Encoding"] = "gzip"; |
258 | |||
256 | using (MemoryStream ms = new MemoryStream()) | 259 | using (MemoryStream ms = new MemoryStream()) |
257 | { | 260 | { |
258 | using (GZipStream comp = new GZipStream(ms, CompressionMode.Compress)) | 261 | using (GZipStream comp = new GZipStream(ms, CompressionMode.Compress)) |
@@ -270,10 +273,9 @@ namespace OpenSim.Framework | |||
270 | } | 273 | } |
271 | else | 274 | else |
272 | { | 275 | { |
273 | request.ContentType = "application/json"; | ||
274 | request.ContentLength = buffer.Length; //Count bytes to send | 276 | request.ContentLength = buffer.Length; //Count bytes to send |
275 | using (Stream requestStream = request.GetRequestStream()) | 277 | using (Stream requestStream = request.GetRequestStream()) |
276 | requestStream.Write(buffer, 0, buffer.Length); //Send it | 278 | requestStream.Write(buffer, 0, buffer.Length); //Send it |
277 | } | 279 | } |
278 | } | 280 | } |
279 | 281 | ||