about summary refs log tree commit homepage
path: root/ext
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-05-07 18:20:49 +0000
committerEric Wong <normalperson@yhbt.net>2010-05-07 18:28:05 +0000
commit935912a422cabfd323f9b4ff268ded09a2ebe7a6 (patch)
tree72a66d5a4cb8ca29746b81958879f15ff8f85b96 /ext
parent3c6fceea7bca1932081113c516da7a94b94fe9c6 (diff)
downloadunicorn-935912a422cabfd323f9b4ff268ded09a2ebe7a6.tar.gz
This is allowed by RFC 2616, section 2.2, where spaces and
horizontal tabs are counted as linear white space and linear
white space (not just regular spaces) may prefix field-values
(section 4.2).

This has _not_ been a real issue in ~4 years of using this
parser (starting with Mongrel) with clients in the wild.

Thanks to IƱaki Baz Castillo for pointing this out.
Diffstat (limited to 'ext')
-rw-r--r--ext/unicorn_http/unicorn_http_common.rl2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/unicorn_http/unicorn_http_common.rl b/ext/unicorn_http/unicorn_http_common.rl
index 6fca604..f165e3f 100644
--- a/ext/unicorn_http/unicorn_http_common.rl
+++ b/ext/unicorn_http/unicorn_http_common.rl
@@ -54,7 +54,7 @@
 
   value_cont = lws+ any* >start_value %write_cont_value;
 
-  message_header = ((field_name ":" " "* field_value)|value_cont) :> CRLF;
+  message_header = ((field_name ":" lws* field_value)|value_cont) :> CRLF;
   chunk_ext_val = token*;
   chunk_ext_name = token*;
   chunk_extension = ( ";" " "* chunk_ext_name ("=" chunk_ext_val)? )*;