diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-08-18 23:45:04 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-08-18 23:45:04 -0700 |
commit | c9f80eebc4ec8f717f667970d4c2763f96283ebd (patch) | |
tree | ff498218314d8825f71b807563083422258f349d /ext/unicorn_http/unicorn_http_common.rl | |
parent | 79bba4abefb57f12b54ddd338ed8f9ec828b5e89 (diff) | |
download | unicorn-c9f80eebc4ec8f717f667970d4c2763f96283ebd.tar.gz |
While I still consider pound to be irrelevant, but I still sometimes get hand-crafted HTTP requests that come in with multiline headers. Since these are part of the HTTP specs and not difficult to support, we might as well support them for the sake of completeness.
Diffstat (limited to 'ext/unicorn_http/unicorn_http_common.rl')
-rw-r--r-- | ext/unicorn_http/unicorn_http_common.rl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/unicorn_http/unicorn_http_common.rl b/ext/unicorn_http/unicorn_http_common.rl index f1ed138..9b51ba1 100644 --- a/ext/unicorn_http/unicorn_http_common.rl +++ b/ext/unicorn_http/unicorn_http_common.rl @@ -19,6 +19,7 @@ uchar = (unreserved | escape | sorta_safe); pchar = (uchar | ":" | "@" | "&" | "=" | "+"); tspecials = ("(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\\" | "\"" | "/" | "[" | "]" | "?" | "=" | "{" | "}" | " " | "\t"); + lws = (" " | "\t"); # elements token = (ascii -- (CTL | tspecials)); @@ -49,7 +50,9 @@ field_value = any* >start_value %write_value; - message_header = field_name ":" " "* field_value :> CRLF; + value_cont = lws+ any* >start_value %write_cont_value; + + message_header = ((field_name ":" " "* field_value)|value_cont) :> CRLF; chunk_ext_val = token*; chunk_ext_name = token*; chunk_extension = ( ";" " "* chunk_ext_name ("=" chunk_ext_val)? )*; |