From: Amos Jeffries Date: Sat, 21 Jun 2014 15:52:55 +0000 (-0700) Subject: RFC 7239 registers Forwarded header X-Git-Tag: SQUID_3_5_0_1~173 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=01498915a1e87430c77cad02ad68532370346691;p=thirdparty%2Fsquid.git RFC 7239 registers Forwarded header 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. --- diff --git a/src/HttpHeader.cc b/src/HttpHeader.cc index 56eb4b32e6..b43a11660b 100644 --- a/src/HttpHeader.cc +++ b/src/HttpHeader.cc @@ -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; diff --git a/src/HttpHeader.h b/src/HttpHeader.h index 8000dd50c6..ad5079bfda 100644 --- a/src/HttpHeader.h +++ b/src/HttpHeader.h @@ -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