From c929ae11759efc1f21c9b9040db6444309ac43fc Mon Sep 17 00:00:00 2001 From: Jun Kurihara Date: Sat, 13 Aug 2022 04:33:32 +0900 Subject: [PATCH] update comment --- src/handler/utils_headers.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/handler/utils_headers.rs b/src/handler/utils_headers.rs index 965cc39..2fc977e 100644 --- a/src/handler/utils_headers.rs +++ b/src/handler/utils_headers.rs @@ -96,7 +96,9 @@ pub(super) fn add_header_entry_overwrite_if_exist( } pub(super) fn make_cookie_single_line(headers: &mut HeaderMap) -> Result<()> { - // Sometimes violates RFC6265: https://www.rfc-editor.org/rfc/rfc6265#section-5.4 + // Sometimes violates RFC6265 (for http/1.1). + // https://www.rfc-editor.org/rfc/rfc6265#section-5.4 + // This is allowed in RFC7540 (for http/2). // https://stackoverflow.com/questions/4843556/in-http-specification-what-is-the-string-that-separates-cookies let cookies = headers .iter() @@ -123,6 +125,8 @@ pub(super) fn add_forwarding_header( let canonical_client_addr = client_addr.to_canonical().ip().to_string(); append_header_entry_with_comma(headers, "x-forwarded-for", &canonical_client_addr)?; + // Single line cookie header + // TODO: This should be only for HTTP/1.1. For 2+, this can be multi-lined. make_cookie_single_line(headers)?; /////////// As Nginx