]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Support RFC 2965 Set-Cookie2 / Cookie2 headers
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 17 Dec 2010 19:54:50 +0000 (12:54 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 17 Dec 2010 19:54:50 +0000 (12:54 -0700)
src/HttpHeader.cc
src/HttpHeader.h
src/client_side_reply.cc

index c317b05dfe0868fc40840fee34a8874486c1097e..ded8f4e4b6e03e8751dee70a2c46c9fc4f99f121 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 76a5b3b70f5db8ae43c2200d6b25388231378506..c734bb1628e1c8f03f741b1ad84d334fd88fc816 100644 (file)
@@ -73,6 +73,7 @@ typedef enum {
     HDR_CONTENT_RANGE,
     HDR_CONTENT_TYPE,
     HDR_COOKIE,
+    HDR_COOKIE2,
     HDR_DATE,
     HDR_ETAG,
     HDR_EXPIRES,
@@ -102,6 +103,7 @@ typedef enum {
     HDR_RETRY_AFTER,
     HDR_SERVER,
     HDR_SET_COOKIE,
+    HDR_SET_COOKIE2,
     HDR_TE,
     HDR_TITLE,
     HDR_TRAILER,
index 8223c103582a1ecf1f3422f142c6ceb7d3b7b48c..37823a9e6db155f312aaa6de88345ad502fa061d 100644 (file)
@@ -1216,6 +1216,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