ASP.NET 中的多个标头
我正在运行的代码似乎在代码中点击了两次“AppendHeader”。
Response.Filter = New DeflateStream(Response.Filter, CompressionMode.Compress, True)
Response.AppendHeader("Content-encoding", "deflate")
...
Response.AppendHeader("Content-encoding", "deflate")
我尝试使用以下...
Response.Headers("Content-encoding") = "deflate"
但它说
This operation requires IIS integrated pipeline mode.
如何检查标头是否存在,并覆盖它而不是附加它。
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 requires IIS integrated pipeline mode.
How do I check for a headers existence, and overwrite it rather than appending it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
怎么样:
What about:
在 IIS 集成模式下运行您的应用程序怎么样?这是 IIS 管理器中 AppPool 的一项设置。
此外,您还可以使用 Fiddler 来帮助调试标头。
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.
总结一下 Response.AppendHeader &
Response.Headers["Content-encoding"]
不适用于 IIS6To summarize
Response.AppendHeader
&Response.Headers["Content-encoding"]
won't work with IIS6