When working with HTTP modules, did anyone notice that the last two events in the pipeline - PreSendRequestHeaders and PreSendRequestContent - do not always fire?
I checked that the code associated with EndRequest will run, but will not be bound to PreSendRequestHeaders or PreSendRequestContent.
Is there a reason? I thought this was a caching problem (with 304 Not Modified, you are not actually sending content ...), but I cleared the caches and decided that the server returns 200 OK, which indicates that it sent the content.
This is a problem because the StatusCode of the response defaults to 200, and I understand that it does not upgrade to something like 404 or 206 to those last two final methods. If I check StatusCode during EndRequest, it will always read 200.
source
share