Sha256: 57fef00b99d85556951bbbf48f3451674fc8099c9eb74dc1d4a1b7514d946e90

Contents?: true

Size: 1.78 KB

Versions: 65

Compression:

Stored size: 1.78 KB

Contents

%%{

  machine puma_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 ) ("?" %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 $snake_upcase_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

65 entries across 62 versions & 4 rubygems

Version Path
puma-5.5.0-java ext/puma_http11/http11_parser_common.rl
puma-5.5.0 ext/puma_http11/http11_parser_common.rl
piesync-puma-5.4.0.1 ext/puma_http11/http11_parser_common.rl
puma-5.4.0-java ext/puma_http11/http11_parser_common.rl
puma-5.4.0 ext/puma_http11/http11_parser_common.rl
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/puma-5.2.2/ext/puma_http11/http11_parser_common.rl
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/puma-5.2.1/ext/puma_http11/http11_parser_common.rl
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/puma-5.1.1/ext/puma_http11/http11_parser_common.rl
puma-5.3.2-java ext/puma_http11/http11_parser_common.rl
puma-5.3.2 ext/puma_http11/http11_parser_common.rl
puma-5.3.1-java ext/puma_http11/http11_parser_common.rl
puma-5.3.1 ext/puma_http11/http11_parser_common.rl
puma-4.3.8-java ext/puma_http11/http11_parser_common.rl
puma-4.3.8 ext/puma_http11/http11_parser_common.rl
puma-5.3.0-java ext/puma_http11/http11_parser_common.rl
puma-5.3.0 ext/puma_http11/http11_parser_common.rl
puma-5.2.2-java ext/puma_http11/http11_parser_common.rl
puma-5.2.2 ext/puma_http11/http11_parser_common.rl
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/puma-5.1.1/ext/puma_http11/http11_parser_common.rl
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/puma-5.2.1/ext/puma_http11/http11_parser_common.rl