diff options
author | zedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9> | 2006-08-08 09:26:23 +0000 |
---|---|---|
committer | zedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9> | 2006-08-08 09:26:23 +0000 |
commit | ee675d5a703efaab60ef90a8b41f87348d928db7 (patch) | |
tree | b8336ff7fd69bdd266223e8b20ed8c7f4a9d7b41 /ext/http11/http11_parser.rl | |
parent | 54465456845ab83a161c9bede172a14988640603 (diff) | |
download | unicorn-ee675d5a703efaab60ef90a8b41f87348d928db7.tar.gz |
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@311 19e92222-5c0b-0410-8929-a290d50e31e9
Diffstat (limited to 'ext/http11/http11_parser.rl')
-rw-r--r-- | ext/http11/http11_parser.rl | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/ext/http11/http11_parser.rl b/ext/http11/http11_parser.rl index b16946d..e3543c1 100644 --- a/ext/http11/http11_parser.rl +++ b/ext/http11/http11_parser.rl @@ -51,6 +51,11 @@ parser->http_version(parser->data, PTR_TO(mark), LEN(mark, fpc)); } + action request_path { + if(parser->request_path != NULL) + parser->request_path(parser->data, PTR_TO(mark), LEN(mark,fpc)); + } + action done { parser->body_start = fpc - buffer + 1; if(parser->header_done != NULL) @@ -81,16 +86,16 @@ # URI schemes and absolute paths scheme = ( alpha | digit | "+" | "-" | "." )* ; - absolute_uri = (scheme ":" (uchar | reserved )*) >mark %request_uri; + absolute_uri = (scheme ":" (uchar | reserved )*); path = (pchar+ ( "/" pchar* )*) ; query = ( uchar | reserved )* >start_query %query_string ; param = ( pchar | "/" )* ; params = (param ( ";" param )*) ; - rel_path = (path? (";" params)?) ("?" query)?; + rel_path = (path? %request_path (";" params)?) ("?" query)?; absolute_path = ("/"+ rel_path); - Request_URI = ("*" %request_uri | absolute_uri | absolute_path) >mark %request_uri; + Request_URI = ("*" | absolute_uri | absolute_path) >mark %request_uri; Method = (upper | digit | safe){1,20} >mark %request_method; http_number = (digit+ "." digit+) ; |