Sha256: 944d12b672658bc01ebec168dc5af62fa8aac6b7a9f98c2c046667fe7327a894

Contents?: true

Size: 1.81 KB

Versions: 18

Compression:

Stored size: 1.81 KB

Contents

%%{
  
  machine http_parser_common;

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

# character types
  CTL = (cntrl | 127);
  safe = ("$" | "-" | "_" | ".");
  extra = ("!" | "*" | "'" | "(" | ")" | ",");
  reserved = (";" | "/" | "?" | ":" | "@" | "&" | "=" | "+");
  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 | sorta_safe);
  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

18 entries across 18 versions & 5 rubygems

Version Path
grockit-thin-0.8.2 ext/thin_parser/common.rl
macournoyer-thin-1.0.1 ext/thin_parser/common.rl
macournoyer-thin-1.1.0 ext/thin_parser/common.rl
michaelyta-thin-1.2.2 ext/thin_parser/common.rl
middleman-0.10.17 vendor/gems/gems/thin-1.2.5/ext/thin_parser/common.rl
middleman-0.10.16 vendor/gems/gems/thin-1.2.5/ext/thin_parser/common.rl
middleman-0.10.15 vendor/gems/gems/thin-1.2.5/ext/thin_parser/common.rl
middleman-0.10.14 vendor/gems/gems/thin-1.2.5/ext/thin_parser/common.rl
thin-1.2.3-x86-mswin32 ext/thin_parser/common.rl
thin-1.2.4-x86-mswin32 ext/thin_parser/common.rl
thin-1.2.4 ext/thin_parser/common.rl
thin-1.2.3 ext/thin_parser/common.rl
thin-0.8.2 ext/thin_parser/common.rl
thin-0.8.0 ext/thin_parser/common.rl
thin-0.8.1 ext/thin_parser/common.rl
thin-1.2.2 ext/thin_parser/common.rl
thin-1.0.0 ext/thin_parser/common.rl
thin-1.2.1 ext/thin_parser/common.rl