Skip to content

Instantly share code, notes, and snippets.

@tmm1
Created October 17, 2010 06:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmm1/630606 to your computer and use it in GitHub Desktop.
Save tmm1/630606 to your computer and use it in GitHub Desktop.
changes made to mongrel ragel parser in Thin
--- 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