[Mono-list] Xsp2 + Mono 2.4 + Deflate compression - errorous leading chars

Bálint Kardos kardosbalint at gmail.com
Wed May 13 09:51:59 EDT 2009


Hi,
I have the following in my Global.asax.cs:

void Application_PreRequestHandlerExecute(object sender, EventArgs e)
        {


            HttpApplication app = sender as HttpApplication;
            string acceptEncoding = app.Request.Headers["Accept-Encoding"];
            Stream prevUncompressedStream = app.Response.Filter;

            app.Response.Charset = "utf-8";

            string acceptEncoding = acceptEncoding.ToLower();

                if (acceptEncoding.Contains("deflate"))
                {
                    // deflate is 21-41% faster!
                    app.Response.Filter = new
DeflateStream(prevUncompressedStream,
                        CompressionMode.Compress);
                    app.Response.AppendHeader("Content-Encoding",
"deflate");
                }
}

If I serve static UTF-8 files like CSS or JS files via xsp2+mono2.4 on
Vista64,   the following bytes are written before my original content:

000000000  02 00 00 00 FF FF


It's a mono-only issue (on IIS/WebDev it's fine), if I disable compression,
it works on mono too.
My files are in UTF-8, however the app.Response.Filter stream is UTF-8 too.


The Headers sent:

Date

Wed, 13 May 2009 13:47:07 GMT

Server

Mono.WebServer2/0.2.0.0 Win32NT

Content-Encoding


deflate

Vary

Content-Encoding

Last-Modified

Fri, 01 May 2009 20:01:43 GMT

X-AspNet-Version

2.0.50727

Content-Length

1463

Cache-Control


private

Content-Type

text/css; charset=utf-8

Keep-Alive

timeout=15, max=99

Connection

Keep-Alive



Any hints?



üdvözlettel
with regards

Kardos Bálint
_______________________________________
http://skaelede.hu 10 (0xA) év a magyar weben
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20090513/143465b8/attachment-0001.html 


More information about the Mono-list mailing list