]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
RFC 7239 registers Forwarded header
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 21 Jun 2014 15:52:55 +0000 (08:52 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 21 Jun 2014 15:52:55 +0000 (08:52 -0700)
This heade obsoletes X-forwarded-For and many other X-* headers.

For now we do nothing special with it except statistics gathering.
Future work will remove X-Forwarded-For support.

src/HttpHeader.cc
src/HttpHeader.h

index 56eb4b32e61dcf039829cada933ee8a5b59a172e..b43a11660b33f4f08143a68ad1238c8d716bb95b 100644 (file)
@@ -111,6 +111,7 @@ static const HttpHeaderFieldAttrs HeadersAttrs[] = {
     {"ETag", HDR_ETAG, ftETag},
     {"Expect", HDR_EXPECT, ftStr},
     {"Expires", HDR_EXPIRES, ftDate_1123},
+    {"Forwarded", HDR_FORWARDED, ftStr},
     {"From", HDR_FROM, ftStr},
     {"Host", HDR_HOST, ftStr},
     {"HTTP2-Settings", HDR_HTTP2_SETTINGS, ftStr}, /* for now */
@@ -216,6 +217,7 @@ static http_hdr_type ListHeadersArr[] = {
 #endif
     HDR_SURROGATE_CAPABILITY,
     HDR_SURROGATE_CONTROL,
+    HDR_FORWARDED,
     HDR_X_FORWARDED_FOR
 };
 
@@ -267,7 +269,7 @@ static http_hdr_type RequestHeadersArr[] = {
     HDR_ORIGIN,
     HDR_PROXY_CONNECTION,
     HDR_PROXY_AUTHORIZATION, HDR_RANGE, HDR_REFERER, HDR_REQUEST_RANGE,
-    HDR_USER_AGENT, HDR_X_FORWARDED_FOR, HDR_SURROGATE_CAPABILITY
+    HDR_USER_AGENT, HDR_FORWARDED, HDR_X_FORWARDED_FOR, HDR_SURROGATE_CAPABILITY
 };
 
 static HttpHeaderMask HopByHopHeadersMask;
index 8000dd50c6f2ee0f876c58d4c2ed0c5350a7caff..ad5079bfda561c46c48c9a6f161b177ceea2b9de 100644 (file)
@@ -83,6 +83,7 @@ typedef enum {
     HDR_ETAG,                           /**< RFC 2608, 2616 */
     HDR_EXPECT,                         /**< RFC 2616, 2616 */
     HDR_EXPIRES,                        /**< RFC 2608, 2616 */
+    HDR_FORWARDED,                      /**< RFC 7239 */
     HDR_FROM,                           /**< RFC 2608, 2616 */
     HDR_HOST,                           /**< RFC 2608, 2616 */
     HDR_HTTP2_SETTINGS,                 /**< HTTP/2.0 upgrade header. see draft-ietf-httpbis-http2-04 */
@@ -137,7 +138,7 @@ typedef enum {
     HDR_AUTHENTICATION_INFO,            /**< RFC 2617 */
     HDR_X_CACHE,                        /**< Squid custom header */
     HDR_X_CACHE_LOOKUP,                        /**< Squid custom header. temporary hack that became de-facto. TODO remove */
-    HDR_X_FORWARDED_FOR,                /**< Squid custom header */
+    HDR_X_FORWARDED_FOR,                /**< obsolete Squid custom header */
     HDR_X_REQUEST_URI,                  /**< Squid custom header appended if ADD_X_REQUEST_URI is defined */
     HDR_X_SQUID_ERROR,                  /**< Squid custom header on generated error responses */
 #if X_ACCELERATOR_VARY