views:

292

answers:

1

I have a HttpHandler that is called whenever an image extension is accessed. This is what I have in the HttpHandler as a simple test:

public void ProcessRequest(HttpContext context)
{    
    context.Response.Write(context.Request.Url.ToString());
    context.Response.End();
}

According to Firebug, the first time the page is refreshed (Ctrl+F5), the URL is shown correctly in the response. However, if I refresh it again (F5), it'll repeat the URL 3 times:

First time:

http://server/image.jpg

Subsequent times:

http://server/image.jpghttp://server/image.jpghttp://server/image.jpg

Does anyone know why this is happening?

A: 

I tried your code and refresh page in different browsers and there is no repeating URL.

Anwar Chandra
Turns out I set the wrong ContentType (it was setting it as `image.png?width=250`). Dunno why this would produce 3 times the request URL on a refresh though.
Daniel T.