2
我有一个PHP代理,它接收HTTP请求并更改HTTP请求的头部之一。一旦HTTP请求离开代理,大部分头文件应该从原始请求(由代理接收的请求)连同请求主体一起传播。通过代理服务器后应该跳过哪些HTTP头文件?
这是我做的传播在我的代码:
foreach (getallheaders() as $name => $value) {
if (($name != "Server") || ($name != "Connection") ||
($name != "Host") || ($name != "Cache-Control") ||
($header != "Content-Length")) {
array_push($headers, "$name: $value");
}
}
//this is where I set the headers of the new request
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
我的问题:我有没有覆盖所有不应该在新的请求被传播的头?如果不是,我不应传播哪些标题?
预先感谢您。
非常感谢Stan,我应该从一开始就检查RFC2616。 –