I'm running code that seems to hit the "AppendHeader" twice in the code.
Response.Filter = New DeflateStream(Response.Filter, CompressionMode.Compress, True)
Response.AppendHeader("Content-encoding", "deflate")
...
Response.AppendHeader("Content-encoding", "deflate")
I have tried using the following....
Response.Headers("Content-encoding") = "deflate"
But it says
This operation requir开发者_Go百科es IIS integrated pipeline mode.
How do I check for a headers existence, and overwrite it rather than appending it.
What about:
if (!(Response.Headers["Content-encoding"] ?? "").Contains("deflate"))
{
Response.AddHeader("Content-encoding", "deflate");
}
How about running your app in IIS Integrated Mode? It's a setting on the AppPool in IIS Manager.
Also, you can use Fiddler to help debug the headers.
To summarize Response.AppendHeader
& Response.Headers["Content-encoding"]
won't work with IIS6
精彩评论