From: Amos Jeffries Date: Mon, 1 Nov 2010 00:52:59 +0000 (-0600) Subject: Support RFC 2965 Set-Cookie2 / Cookie2 headers X-Git-Tag: take1~124 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f89d40128eb2da001af20101ff5e8449896e6764;p=thirdparty%2Fsquid.git Support RFC 2965 Set-Cookie2 / Cookie2 headers --- diff --git a/src/HttpHeader.cc b/src/HttpHeader.cc index f26d380e61..c2fa9904af 100644 --- a/src/HttpHeader.cc +++ b/src/HttpHeader.cc @@ -92,6 +92,7 @@ static const HttpHeaderFieldAttrs HeadersAttrs[] = { {"Content-Range", HDR_CONTENT_RANGE, ftPContRange}, {"Content-Type", HDR_CONTENT_TYPE, ftStr}, {"Cookie", HDR_COOKIE, ftStr}, + {"Cookie2", HDR_COOKIE2, ftStr}, {"Date", HDR_DATE, ftDate_1123}, {"ETag", HDR_ETAG, ftETag}, {"Expires", HDR_EXPIRES, ftDate_1123}, @@ -121,6 +122,7 @@ static const HttpHeaderFieldAttrs HeadersAttrs[] = { {"Retry-After", HDR_RETRY_AFTER, ftStr}, /* for now (ftDate_1123 or ftInt!) */ {"Server", HDR_SERVER, ftStr}, {"Set-Cookie", HDR_SET_COOKIE, ftStr}, + {"Set-Cookie2", HDR_SET_COOKIE2, ftStr}, {"TE", HDR_TE, ftStr}, {"Title", HDR_TITLE, ftStr}, {"Trailer", HDR_TRAILER, ftStr}, @@ -222,7 +224,7 @@ static http_hdr_type ReplyHeadersArr[] = { HDR_ACCEPT, HDR_ACCEPT_CHARSET, HDR_ACCEPT_ENCODING, HDR_ACCEPT_LANGUAGE, HDR_ACCEPT_RANGES, HDR_AGE, HDR_LOCATION, HDR_MAX_FORWARDS, - HDR_MIME_VERSION, HDR_PUBLIC, HDR_RETRY_AFTER, HDR_SERVER, HDR_SET_COOKIE, + HDR_MIME_VERSION, HDR_PUBLIC, HDR_RETRY_AFTER, HDR_SERVER, HDR_SET_COOKIE, HDR_SET_COOKIE2, HDR_VARY, HDR_WARNING, HDR_PROXY_CONNECTION, HDR_X_CACHE, HDR_X_CACHE_LOOKUP, diff --git a/src/HttpHeader.h b/src/HttpHeader.h index 8d317d7dca..e28545139c 100644 --- a/src/HttpHeader.h +++ b/src/HttpHeader.h @@ -72,6 +72,7 @@ typedef enum { HDR_CONTENT_RANGE, HDR_CONTENT_TYPE, HDR_COOKIE, + HDR_COOKIE2, HDR_DATE, HDR_ETAG, HDR_EXPIRES, @@ -101,6 +102,7 @@ typedef enum { HDR_RETRY_AFTER, HDR_SERVER, HDR_SET_COOKIE, + HDR_SET_COOKIE2, HDR_TE, HDR_TITLE, HDR_TRAILER, diff --git a/src/client_side_reply.cc b/src/client_side_reply.cc index 908ca295e6..ee04056c0b 100644 --- a/src/client_side_reply.cc +++ b/src/client_side_reply.cc @@ -1271,6 +1271,7 @@ clientReplyContext::buildReplyHeader() if (is_hit) hdr->delById(HDR_SET_COOKIE); + // TODO: RFC 2965 : Must honour Cache-Control: no-cache="set-cookie2" and remove header. // if there is not configured a peer proxy with login=PASS option enabled // remove the Proxy-Authenticate header