parser.rl
changeset 36 abd2aa4aaca8
parent 33 ba41bfbe87a2
equal deleted inserted replaced
35:c24dbd004cbc 36:abd2aa4aaca8
   131 	#
   131 	#
   132 	# - Redirectors aren't handed any userinfo (http://mahlon:password@example.com),
   132 	# - Redirectors aren't handed any userinfo (http://mahlon:password@example.com),
   133 	#   so no need to check for that.
   133 	#   so no need to check for that.
   134 	#
   134 	#
   135 
   135 
   136 	host_component = alnum | ( alnum [a-zA-Z0-9\-_]* alnum );
   136 	urichar        = ( '%' alnum{2} | alnum );
       
   137 	host_component = urichar | ( urichar [%a-zA-Z0-9\-_]* urichar );
   137 	pchar          = ( alnum | [\-._~!$%&'()*+,;=] );
   138 	pchar          = ( alnum | [\-._~!$%&'()*+,;=] );
   138 	path_segment   = '/' ( any - space )*;
   139 	path_segment   = '/' ( any - space )*;
   139 
   140 
   140 	hostname       = host_component ( '.' host_component )* '.'?;
   141 	hostname       = host_component ( '.' host_component )* '.'?;
   141 	ipv4           = digit{1,3} '.' digit{1,3} '.' digit{1,3} '.' digit{1,3};
   142 	ipv4           = digit{1,3} '.' digit{1,3} '.' digit{1,3} '.' digit{1,3};
   226 
   227 
   227 	action match_error   { debug( 3, LOC, "Unable to parse the rule path matcher.\n" ); }
   228 	action match_error   { debug( 3, LOC, "Unable to parse the rule path matcher.\n" ); }
   228 	action host_error    { debug( 3, LOC, "Unable to parse the rule hostname.\n" ); }
   229 	action host_error    { debug( 3, LOC, "Unable to parse the rule hostname.\n" ); }
   229 	action luapath_error { debug( 3, LOC, "Unable to parse the lua path.\n" ); }
   230 	action luapath_error { debug( 3, LOC, "Unable to parse the lua path.\n" ); }
   230 
   231 
   231 	host_component  = alnum | ( alnum [a-zA-Z0-9\-_]* alnum );
   232 	urichar        = ( '%' alnum{2} | alnum );
   232 	path_segment    = '/' ( any - space )*;
   233 	host_component = urichar | ( urichar [%a-zA-Z0-9\-_]* urichar );
       
   234 	path_segment   = '/' ( any - space )*;
   233 
   235 
   234 	sep       = space+;
   236 	sep       = space+;
   235 	hostname  = host_component ( '.' host_component )* '.'?;
   237 	hostname  = host_component ( '.' host_component )* '.'?;
   236 	ipv4      = digit{1,3} '.' digit{1,3} '.' digit{1,3} '.' digit{1,3};
   238 	ipv4      = digit{1,3} '.' digit{1,3} '.' digit{1,3} '.' digit{1,3};
   237 	ipv6      = ( xdigit | ':' )+;
   239 	ipv6      = ( xdigit | ':' )+;
   305 	action val_start  { dbline->vstart = p; }
   307 	action val_start  { dbline->vstart = p; }
   306 	action val_finish { dbline->vlen = p - ( *pe + dbline->vstart ); }
   308 	action val_finish { dbline->vlen = p - ( *pe + dbline->vstart ); }
   307 	action val_error  { debug( 0, LOC, "Invalid rewrite value\n" ); }
   309 	action val_error  { debug( 0, LOC, "Invalid rewrite value\n" ); }
   308 
   310 
   309 	sep            = space+;
   311 	sep            = space+;
   310 	host_component = alnum | ( alnum [a-zA-Z0-9\-_]* alnum );
   312 	urichar        = ( '%' alnum{2} | alnum );
       
   313 	host_component = urichar | ( urichar [%a-zA-Z0-9\-_]* urichar );
   311 	hostname       = host_component ( '.' host_component )* '.'?;
   314 	hostname       = host_component ( '.' host_component )* '.'?;
   312 	ipv4           = digit{1,3} '.' digit{1,3} '.' digit{1,3} '.' digit{1,3};
   315 	ipv4           = digit{1,3} '.' digit{1,3} '.' digit{1,3} '.' digit{1,3};
   313 	token          = ( any - space )+;
   316 	token          = ( any - space )+;
   314 	host           = ( hostname | ipv4 );
   317 	host           = ( hostname | ipv4 );
   315 
   318