Sha256: c768896bfe1ac4f158d0ae13599fd7369398350da46b83f4d64c01455c585614

Contents?: true

Size: 1.81 KB

Versions: 67

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 = ("%" "u"? 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? (";" params)? %request_path) ("?" %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

67 entries across 67 versions & 4 rubygems

Version Path
classiccms-0.7.5 vendor/bundle/gems/thin-1.3.1/ext/thin_parser/common.rl
classiccms-0.7.4 vendor/bundle/gems/thin-1.3.1/ext/thin_parser/common.rl
classiccms-0.7.3 vendor/bundle/gems/thin-1.3.1/ext/thin_parser/common.rl
classiccms-0.7.2 vendor/bundle/gems/thin-1.3.1/ext/thin_parser/common.rl
classiccms-0.7.1 vendor/bundle/gems/thin-1.3.1/ext/thin_parser/common.rl
classiccms-0.7.0 vendor/bundle/gems/thin-1.3.1/ext/thin_parser/common.rl
thin-1.5.1 ext/thin_parser/common.rl
classiccms-0.6.9 vendor/bundle/gems/thin-1.3.1/ext/thin_parser/common.rl
classiccms-0.6.8 vendor/bundle/gems/thin-1.3.1/ext/thin_parser/common.rl
classiccms-0.6.7 vendor/bundle/gems/thin-1.3.1/ext/thin_parser/common.rl
friendlyfashion-thin-1.4.1.1 ext/thin_parser/common.rl
classiccms-0.6.6 vendor/bundle/gems/thin-1.3.1/ext/thin_parser/common.rl
classiccms-0.6.5 vendor/bundle/gems/thin-1.3.1/ext/thin_parser/common.rl
classiccms-0.6.4 vendor/bundle/gems/thin-1.3.1/ext/thin_parser/common.rl
classiccms-0.6.3 vendor/bundle/gems/thin-1.3.1/ext/thin_parser/common.rl
classiccms-0.6.2 vendor/bundle/gems/thin-1.3.1/ext/thin_parser/common.rl
classiccms-0.6.1 vendor/bundle/gems/thin-1.3.1/ext/thin_parser/common.rl
classiccms-0.6.0 vendor/bundle/gems/thin-1.3.1/ext/thin_parser/common.rl
thin-1.5.0 ext/thin_parser/common.rl
classiccms-0.5.17 vendor/bundle/gems/thin-1.3.1/ext/thin_parser/common.rl