Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Diagnosing why WebResource.axd requests are empty

I'm finding that for one particular web application requests to WebResource.axd are returning a completely empty page. (Copying and pasting the link into a new browser window results in a completley empty response document)

IIS logs showing that the requests to WebResource.axd are successful (HTTP status code 200)

The application itself is complex and so it seems likely that it is something that the application is doing which is causing this, however I don't know what.

What additional debugging steps can I take to work out why these requests are failing, and where should I look for places where application specific behaviour might affect WebResource.axd in this way?

Things I have tried so far:

  • Creating a new virtual directory in IIS pointing towards the same directory gives the same results (empty WebResource.axd document)
  • Creating a completely new indepdent blank page and placing it in this directory gives the same results.
  • If I create a new virtual directory in IIS pointing towards a different folder then the blank page works as expected.
  • Swapping the web.config files between the working / broken directories appears to have no impact.

This is on a Windows XP machine running IIS 5.1

like image 541
Justin Avatar asked Jul 19 '10 05:07

Justin


2 Answers

It turns out that the problem was a HttpResponse filter that I was applying in the Application_PreRequestHandlerExecute method in Global.asax. I was applying the filter generically to all requests - even though the filter left the content unchanged for WebResouce.axd, this still caused problems.

The following links helped me out and describe this in more detail:

  • HttpResponse filter returns nothing
  • http://daniel-richardson.blogspot.com/2008/11/how-to-apply-filter-to-content-returned.html

The solution was to skip applying the filter for WebResouce.axd.

like image 76
Justin Avatar answered Oct 20 '22 13:10

Justin


If you happen to be using Visual Studio 2013 Preview, this is a known issue: https://connect.microsoft.com/VisualStudio/feedback/details/792689/webresource-axd-returns-a-200-ok-empty-response

(obviously this doesn't apply to OP, but to anyone coming from google)

like image 21
Chris Avatar answered Oct 20 '22 12:10

Chris