Sha256: 709714c0ba0c931a87ba0cf75ec78bf82f867c2bd72df374059e86e186943a6c

Contents?: true

Size: 1.77 KB

Versions: 46

Compression:

Stored size: 1.77 KB

Contents

%%{
  
  machine http_parser_common;

#### HTTP PROTOCOL GRAMMAR
# line endings
  CRLF = "\r\n";

# character types
  CTL = (cntrl | 127);
  safe = ("$" | "-" | "_" | ".");
  extra = ("!" | "*" | "'" | "(" | ")" | ",");
  reserved = (";" | "/" | "?" | ":" | "@" | "&" | "=" | "+");
  unsafe = (CTL | " " | "\"" | "#" | "%" | "<" | ">");
  national = any -- (alpha | digit | reserved | extra | safe | unsafe);
  unreserved = (alpha | digit | safe | extra | national);
  escape = ("%" xdigit xdigit);
  uchar = (unreserved | escape);
  pchar = (uchar | ":" | "@" | "&" | "=" | "+");
  tspecials = ("(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\\" | "\"" | "/" | "[" | "]" | "?" | "=" | "{" | "}" | " " | "\t");

# elements
  token = (ascii -- (CTL | tspecials));

# URI schemes and absolute paths
  scheme = ( alpha | digit | "+" | "-" | "." )* ;
  absolute_uri = (scheme ":" (uchar | reserved )*);

  path = ( pchar+ ( "/" pchar* )* ) ;
  query = ( uchar | reserved )* %query_string ;
  param = ( pchar | "/" )* ;
  params = ( param ( ";" param )* ) ;
  rel_path = ( path? %request_path (";" params)? ) ("?" %start_query query)?;
  absolute_path = ( "/"+ rel_path );

  Request_URI = ( "*" | absolute_uri | absolute_path ) >mark %request_uri;
  Fragment = ( uchar | reserved )* >mark %fragment;
  Method = ( upper | digit | safe ){1,20} >mark %request_method;

  http_number = ( digit+ "." digit+ ) ;
  HTTP_Version = ( "HTTP/" http_number ) >mark %http_version ;
  Request_Line = ( Method " " Request_URI ("#" Fragment){0,1} " " HTTP_Version CRLF ) ;

  field_name = ( token -- ":" )+ >start_field %write_field;

  field_value = any* >start_value %write_value;

  message_header = field_name ":" " "* field_value :> CRLF;

  Request = Request_Line ( message_header )* ( CRLF @done );

main := Request;

}%%

Version data entries

46 entries across 46 versions & 6 rubygems

Version Path
headius-mongrel-1.1.6.1 ext/http11/http11_parser_common.rl
phurley-mongrel-1.1.6.1 ext/http11/http11_parser_common.rl
merb-core-1.1.3 spec10/public/webrat/test_app/gems/gems/mongrel-1.1.5/ext/http11/http11_parser_common.rl
merb-core-1.1.2 spec10/public/webrat/test_app/gems/gems/mongrel-1.1.5/ext/http11/http11_parser_common.rl
merb-core-1.1.1 spec10/public/webrat/test_app/gems/gems/mongrel-1.1.5/ext/http11/http11_parser_common.rl
merb-core-1.1.0 spec10/public/webrat/test_app/gems/gems/mongrel-1.1.5/ext/http11/http11_parser_common.rl
merb-core-1.1.0.rc1 spec10/public/webrat/test_app/gems/gems/mongrel-1.1.5/ext/http11/http11_parser_common.rl
sho-mongrel-1.1.5 ext/http11/http11_parser_common.rl
merb-core-1.1.0.pre spec10/public/webrat/test_app/gems/gems/mongrel-1.1.5/ext/http11/http11_parser_common.rl
mongrel-1.0.2 ext/http11/http11_parser_common.rl
mongrel-1.0.4 ext/http11/http11_parser_common.rl
mongrel-1.0.3 ext/http11/http11_parser_common.rl
mongrel-1.1.3-java ext/http11/http11_parser_common.rl
mongrel-1.0.5 ext/http11/http11_parser_common.rl
mongrel-1.1.1 ext/http11/http11_parser_common.rl
mongrel-1.1.2 ext/http11/http11_parser_common.rl
mongrel-1.1.2-java ext/http11/http11_parser_common.rl
mongrel-1.1.3 ext/http11/http11_parser_common.rl
mongrel-1.1.4-x86-mswin32-60 ext/http11/http11_parser_common.rl
mongrel-1.1 ext/http11/http11_parser_common.rl