304响应不设置自定义页眉与mod

编程入门 行业动态 更新时间:2024-10-18 18:21:16
本文介绍了304响应不设置自定义页眉与mod_headers中的Apache的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 <VirtualHost *:80> ServerAdmin webmaster@dev.dom DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs" ServerName dev.dom ServerAlias dev.dom ErrorLog "logs/dev.dom-error.log" CustomLog "logs/dev.dom-access.log" common PassEnv CLUSTER Header always set X-Cluster "%{CLUSTER}e" </VirtualHost>

下面是我的配置。我有一个环境变量,它告诉我,我是什么群集上,这是在X-集群的标题传递。这将返回罚款200或404的响应,但304未修改响应永远不会返回头,虽然它返回其他相应的Apache头。

Here is my configuration. I have an environment variable which tells me what cluster I am on, which is passed as a header in 'X-Cluster'. This returns fine on a 200 or a 404 response, but a 304 Not Modified response never returns the header, even though it returns other appropriate Apache headers.

我如何获得的头一个304响应期间设置?

How do I get the header to be set during a 304 response?

推荐答案

阿帕奇明确禁止修改响应头为符合HTTP规范一个304响应。这种类型的响应的名称为未改性。您可以使用Apache的滤波器结构,修改此行为通过编写自定义的模块,或者与可能的mod_perl,但它是最有可能的错误的做法。

Apache explicitly prohibits modifying the response headers in a 304 response for compliance with the http spec. The name of this type of response is "Not modified". You can modify this behavior using Apache's filter architecture, by writing a custom module, or with mod_perl perhaps, but it's most likely the wrong thing to do.

更多推荐

304响应不设置自定义页眉与mod

本文发布于:2023-11-01 02:04:57,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1547930.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:页眉   自定义   mod

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!