aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2014-08-06 11:32:58 +0200
committerLoïc Hoguin <[email protected]>2014-08-06 11:32:58 +0200
commit260fc1e60b6cc231e026d0aa28a24bf7dec7539a (patch)
tree4a8290aad29a5969e9d2df697d7554a2fc411cee
parent3625d6a2e2e262b0e303901237f3d89db716bb41 (diff)
downloadcowboy-260fc1e60b6cc231e026d0aa28a24bf7dec7539a.tar.gz
cowboy-260fc1e60b6cc231e026d0aa28a24bf7dec7539a.tar.bz2
cowboy-260fc1e60b6cc231e026d0aa28a24bf7dec7539a.zip
Handle absolute URIs that lack a path entirely
-rw-r--r--src/cowboy_protocol.erl3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cowboy_protocol.erl b/src/cowboy_protocol.erl
index cc46590..1026d28 100644
--- a/src/cowboy_protocol.erl
+++ b/src/cowboy_protocol.erl
@@ -191,6 +191,9 @@ parse_uri_skip_host(<< C, Rest/bits >>, State, Method) ->
case C of
$\r -> error_terminate(400, State);
$/ -> 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)
end.