Jan 19, 2012, 3:20 PM
[CLOSED] Ext.Net Compression Utils bug with non Gzip support
Hi,
In Ext.Net.Utilities in the CompressionUtils class, you have this bit of code:
This causes problems for example with IE6 and when using a DirectResponse to return to the browser. This means that when calling DirectRequest methods, it always results in a response failure for IE6.
I found this when using an ashx, similar to this:
Thanks!
In Ext.Net.Utilities in the CompressionUtils class, you have this bit of code:
public static void GZipAndSend(byte[] instance, string responseType)
{
if (CompressionUtils.IsGZipSupported)
{
CompressionUtils.Send(CompressionUtils.GZip(instance), responseType);
}
else
{
CompressionUtils.Send(instance, responseType);
}
}
public static void Send(byte[] instance, string responseType)
{
HttpResponse response = HttpContext.Current.Response;
response.AppendHeader("Content-Encoding", "gzip");
response.Charset = "utf-8";
response.ContentType = responseType;
response.BinaryWrite(instance);
}
The problem is that the response header will always get Content-Encoding of "gzip" even if Gzip is not supported, because GZipAndSend calls Send() in both cases, and Send() always fixed the content-encoding to "gzip"This causes problems for example with IE6 and when using a DirectResponse to return to the browser. This means that when calling DirectRequest methods, it always results in a response failure for IE6.
I found this when using an ashx, similar to this:
using System.Web;
using Ext.Net;
namespace MyExample
{
public class Example : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/json";
var response = new DirectResponse { Success = true };
try
{
// do stuff here
}
catch (Exception e)
{
response.Success = false;
response.ErrorMessage = e.Message;
}
response.Return();
}
public bool IsReusable
{
get { return false; }
}
}
}
Is this something that can be looked at soon as I can't think of a workaround.Thanks!
Last edited by Daniil; Jan 20, 2012 at 12:21 PM.
Reason: [CLOSED]