header.len + 2;
}
-#if DEAD_CODE // 2009-01-20: inlined this with its ONLY caller (copyOneHeader...)
--/**
-- * Returns true if HTTP allows us to pass this header on. Does not
-- * check anonymizer (aka header_access) configuration.
-- */
--int
--httpRequestHdrAllowed(const HttpHeaderEntry * e, String * strConn)
--{
-- assert(e);
-- /* check connection header */
--
- if (strConn && strListIsMember(strConn, e->name.termedBuf(), ','))
- if (strConn && strListIsMember(strConn, e->name.buf(), ','))
-- return 0;
--
-- return 1;
--}
-#endif
--
/* sync this routine when you update HttpRequest struct */
void
HttpRequest::hdrCacheInit()
strConnection.clean();
}
+ /**
+ * Decides whether a particular header may be cloned from the received Clients request
+ * to our outgoing fetch request.
+ */
void
- copyOneHeaderFromClientsideRequestToUpstreamRequest(const HttpHeaderEntry *e, String strConnection, HttpRequest * request, HttpRequest * orig_request, HttpHeader * hdr_out, int we_do_ranges, http_state_flags flags)
+ copyOneHeaderFromClientsideRequestToUpstreamRequest(const HttpHeaderEntry *e, const String strConnection, HttpRequest * request, const HttpRequest * orig_request, HttpHeader * hdr_out, const int we_do_ranges, const http_state_flags flags)
{
- debugs(11, 5, "httpBuildRequestHeader: " << e->name.buf() << ": " << e->value.buf());
+ debugs(11, 5, "httpBuildRequestHeader: " << e->name << ": " << e->value );
- if (!httpRequestHdrAllowed(e, &strConnection)) {
- debugs(11, 2, "'" << e->name << "' header denied by anonymize_headers configuration");
- return;
- }
-
switch (e->id) {
+ /** \title RFC 2616 sect 13.5.1 - Hop-by-Hop headers which Squid should not pass on. */
+
case HDR_PROXY_AUTHORIZATION:
- /* Only pass on proxy authentication to peers for which
+ /** \par Proxy-Authorization:
+ * Only pass on proxy authentication to peers for which
* authentication forwarding is explicitly enabled
*/
break;
default:
- /* pass on all other header fields */
+ /** \par default.
+ * pass on all other header fields
+ * which are NOT listed by the special Connection: header. */
+
+ if (strConnection.size()>0 && strListIsMember(&strConnection, e->name.buf(), ',')) {
- debugs(11, 2, "'" << e->name.buf() << "' header cropped by Connection: definition");
++ debugs(11, 2, "'" << e->name << "' header cropped by Connection: definition");
+ return;
+ }
+
hdr_out->addEntry(e->clone());
}
}