Created
October 17, 2010 06:42
-
-
Save tmm1/630606 to your computer and use it in GitHub Desktop.
changes made to mongrel ragel parser in Thin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- mongrel/ext/http11/http11_parser_common.rl 2010-10-13 01:08:57.000000000 -0700 | |
+++ thin/ext/thin_parser/common.rl 2010-06-18 18:36:01.000000000 -0700 | |
@@ -11,11 +11,12 @@ | |
safe = ("$" | "-" | "_" | "."); | |
extra = ("!" | "*" | "'" | "(" | ")" | ","); | |
reserved = (";" | "/" | "?" | ":" | "@" | "&" | "=" | "+"); | |
- unsafe = (CTL | " " | "\"" | "#" | "%" | "<" | ">"); | |
+ sorta_safe = ("\"" | "<" | ">"); | |
+ unsafe = (CTL | " " | "#" | "%" | sorta_safe); | |
national = any -- (alpha | digit | reserved | extra | safe | unsafe); | |
unreserved = (alpha | digit | safe | extra | national); | |
escape = ("%" xdigit xdigit); | |
- uchar = (unreserved | escape); | |
+ uchar = (unreserved | escape | sorta_safe); | |
pchar = (uchar | ":" | "@" | "&" | "=" | "+"); | |
tspecials = ("(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\\" | "\"" | "/" | "[" | "]" | "?" | "=" | "{" | "}" | " " | "\t"); | |
@@ -30,7 +31,7 @@ | |
query = ( uchar | reserved )* %query_string ; | |
param = ( pchar | "/" )* ; | |
params = ( param ( ";" param )* ) ; | |
- rel_path = ( path? %request_path (";" params)? ) ("?" %start_query query)?; | |
+ rel_path = ( path? (";" params)? %request_path) ("?" %start_query query)?; | |
absolute_path = ( "/"+ rel_path ); | |
Request_URI = ( "*" | absolute_uri | absolute_path ) >mark %request_uri; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment