Bug #7021

WEBrick::HTTPUtils.parse_header "normalizing" white space of cookie values.

Added by boris317 (shawn adams) over 7 years ago. Updated 8 months ago.

Target version:
ruby -v:
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.3.0]


parse_header calls value.gsub!(/\s+/, " ") on ALL header values. I am using a web framework that runs on WEBrick as an HTTP proxy. When the cookies pass through the proxy the whitespace is normalized which is actually breaking the outgoing service call. There is a length "flag" in the cookie and stripping any whitespace from it breaks that. Is it intended behavior to normalize whitespace in request cookie values?

Updated by boris317 (shawn adams) over 7 years ago

I forgot to add this in the description here is the style of cookie that is giving me issues:

Cookie: testcookie=FOO BAR8;

There are two spaces between and FOO and BAR and its important that they stay that way.

Updated by zzak (Zachary Scott) over 7 years ago

  • Category set to lib
  • Assignee set to nahi (Hiroshi Nakamura)

Updated by usa (Usaku NAKAMURA) over 7 years ago

  • Status changed from Open to Assigned

Updated by jeremyevans0 (Jeremy Evans) 10 months ago

I agree this is a bug that violates RFC 2616 and RFC 7230 and have submitted a pull request to fix this issue:

Updated by jeremyevans0 (Jeremy Evans) 8 months ago

  • Status changed from Assigned to Closed

Also available in: Atom PDF