Browse Source

Handle absolute URIs that lack a path entirely

Loïc Hoguin 10 years ago
parent
commit
260fc1e60b
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/cowboy_protocol.erl

+ 3 - 0
src/cowboy_protocol.erl

@@ -191,6 +191,9 @@ parse_uri_skip_host(<< C, Rest/bits >>, State, Method) ->
 	case C of
 	case C of
 		$\r -> error_terminate(400, State);
 		$\r -> error_terminate(400, State);
 		$/ -> parse_uri_path(Rest, State, Method, <<"/">>);
 		$/ -> parse_uri_path(Rest, State, Method, <<"/">>);
+		$\s -> parse_version(Rest, State, Method, <<"/">>, <<>>);
+		$? -> parse_uri_query(Rest, State, Method, <<"/">>, <<>>);
+		$# -> skip_uri_fragment(Rest, State, Method, <<"/">>, <<>>);
 		_ -> parse_uri_skip_host(Rest, State, Method)
 		_ -> parse_uri_skip_host(Rest, State, Method)
 	end.
 	end.