]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Support RFC 2965 Set-Cookie2 / Cookie2 headers
authorAmos Jeffries <amosjeffries@squid-cache.org>
Mon, 1 Nov 2010 00:52:59 +0000 (18:52 -0600)
committerAmos Jeffries <amosjeffries@squid-cache.org>
Mon, 1 Nov 2010 00:52:59 +0000 (18:52 -0600)
src/HttpHeader.cc
src/HttpHeader.h
src/client_side_reply.cc

index f26d380e616e70a80e5bc84343b79d10104e7831..c2fa9904af5bbd78c3424800283d0fff99acab8a 100644 (file)
@@ -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,
index 8d317d7dca23bd8e76a44fced2fb54c6e3d70212..e28545139cb56089b7ba4a96bbb3906e98875e8c 100644 (file)
@@ -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,
index 908ca295e683a562c552a7c682ebd97ef941e7fd..ee04056c0b3393c5caad03ee43900e5d565150a4 100644 (file)
@@ -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