开发者

In ASP.NET MVC app, simple custom HTTPModule issue

开发者 https://www.devze.com 2022-12-21 02:48 出处:网络
My first custom HTTP Module, baby step 1 - just getting the plumbing down. I\'m not getting my string in the 200 response but it is there in 304 responses. Can anyone tell me what I\'m missing?

My first custom HTTP Module, baby step 1 - just getting the plumbing down.

I'm not getting my string in the 200 response but it is there in 304 responses. Can anyone tell me what I'm missing?

My clas开发者_开发知识库s:

namespace WebUI.Models
{
    public class SimpleModule: IHttpModule
    {
        public void Dispose()
        {
        }

        public void Init(HttpApplication context)
        {
            context.EndRequest += OnEndRequest;
        }        

        void OnEndRequest(object sender, System.EventArgs e)
        {            
            HttpContext.Current.Response.Write("rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr");           
        }
    }
}

This is what I'm getting for a request for a css file and there's my "rrrrrr....rrrr" at the end:

HTTP/1.1 304 Not Modified

Content-Type: text/html; charset=utf-8

Last-Modified: Sat, 20 Feb 2010 17:20:59 GMT

Accept-Ranges: bytes

ETag: "b0d1d31151b2ca1:0"

Server: Microsoft-IIS/7.0

X-Powered-By: ASP.NET

Date: Thu, 25 Feb 2010 22:57:31 GMT

rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr

But the r's don't show in my 200 response for the page's html.

Thanks for any help, Bill


OK, figured out why - Compression. I took it out and now I'm getting the rrrr's in my 200 response. Now I just have to figure out why this is so.

//response.Filter = new GZipStream(response.Filter, compress);

0

精彩评论

暂无评论...
验证码 换一张
取 消