aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2014-08-06 11:15:26 +0200
committerLoïc Hoguin <[email protected]>2014-08-06 11:15:26 +0200
commit3625d6a2e2e262b0e303901237f3d89db716bb41 (patch)
tree2db7e309ec6e92fbbb9a867307219665c06f84ae
parenta2fabcdecf0824b8b879f98e0601ab1477e3cb4e (diff)
downloadcowboy-3625d6a2e2e262b0e303901237f3d89db716bb41.tar.gz
cowboy-3625d6a2e2e262b0e303901237f3d89db716bb41.tar.bz2
cowboy-3625d6a2e2e262b0e303901237f3d89db716bb41.zip
Accept absolute URI scheme as uppercase
We should be doing a case insensitive comparison to be correct, but this is more expensive. Almost all clients send lowercase, this patch fixes handling of the aws/aws-sdk-php client which sends uppercase, and no known client sends mixed case so I am holding back on the more expensive solution for the moment.
-rw-r--r--src/cowboy_protocol.erl4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cowboy_protocol.erl b/src/cowboy_protocol.erl
index 84c4401..cc46590 100644
--- a/src/cowboy_protocol.erl
+++ b/src/cowboy_protocol.erl
@@ -180,6 +180,10 @@ parse_uri(<< "http://", Rest/bits >>, State, Method) ->
parse_uri_skip_host(Rest, State, Method);
parse_uri(<< "https://", Rest/bits >>, State, Method) ->
parse_uri_skip_host(Rest, State, Method);
+parse_uri(<< "HTTP://", Rest/bits >>, State, Method) ->
+ parse_uri_skip_host(Rest, State, Method);
+parse_uri(<< "HTTPS://", Rest/bits >>, State, Method) ->
+ parse_uri_skip_host(Rest, State, Method);
parse_uri(Buffer, State, Method) ->
parse_uri_path(Buffer, State, Method, <<>>).