views:

123

answers:

0

I am trying to write an IIS Http Module that requires strict control of the response headers.

I am currently using an Event Handler for PreSendRequestHeaders to remove headers I don't want and add headers I do, but I am unable to remove the Transfer-Encoding header that IIS seems to insist on adding (as the first header as well) and appears to do so after PreSendRequestHeaders.

Is there a way I can get rid of it for requests I specify? Do I really need it at all, eg. is there any harm in removing it for all requests? If not, how do I do that?

Alternatively, is there a way I can just give my module full control of the TCP connection so it can handle headers and all?