From 0fc74a0cc001dfb1bef8ef8bc8fa868dafc059d3 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Fri, 17 Dec 2010 12:54:50 -0700 Subject: [PATCH] Support RFC 2965 Set-Cookie2 / Cookie2 headers --- src/HttpHeader.cc | 4 +++- src/HttpHeader.h | 2 ++ src/client_side_reply.cc | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/HttpHeader.cc b/src/HttpHeader.cc index c317b05dfe..ded8f4e4b6 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 76a5b3b70f..c734bb1628 100644 --- a/src/HttpHeader.h +++ b/src/HttpHeader.h @@ -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, diff --git a/src/client_side_reply.cc b/src/client_side_reply.cc index 8223c10358..37823a9e6d 100644 --- a/src/client_side_reply.cc +++ b/src/client_side_reply.cc @@ -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 -- 2.47.2