aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_http_protocol.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2011-03-19 18:53:59 +0100
committerLoïc Hoguin <[email protected]>2011-03-19 18:53:59 +0100
commita4f8bb65739b8a3b102c244a5ef7e5aa6a9f38e4 (patch)
treeb1684461aa7dab26a70ec5335c1f24b73688613f /src/cowboy_http_protocol.erl
parent2c52a30b0a209cfb0814a42b814271b168ddb2e2 (diff)
downloadcowboy-a4f8bb65739b8a3b102c244a5ef7e5aa6a9f38e4.tar.gz
cowboy-a4f8bb65739b8a3b102c244a5ef7e5aa6a9f38e4.tar.bz2
cowboy-a4f8bb65739b8a3b102c244a5ef7e5aa6a9f38e4.zip
Add support for the '*' path.
Mostly used by the following request: OPTIONS * HTTP/1.1
Diffstat (limited to 'src/cowboy_http_protocol.erl')
-rw-r--r--src/cowboy_http_protocol.erl5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cowboy_http_protocol.erl b/src/cowboy_http_protocol.erl
index 82cf733..b25c2f4 100644
--- a/src/cowboy_http_protocol.erl
+++ b/src/cowboy_http_protocol.erl
@@ -68,6 +68,11 @@ request({http_request, Method, {abs_path, AbsPath}, Version},
{ok, Peer} = Transport:peername(Socket),
wait_header(#http_req{socket=Socket, transport=Transport, method=Method,
version=Version, peer=Peer, path=Path, raw_qs=Qs}, State);
+request({http_request, Method, '*', Version},
+ State=#state{socket=Socket, transport=Transport}) ->
+ {ok, Peer} = Transport:peername(Socket),
+ wait_header(#http_req{socket=Socket, transport=Transport, method=Method,
+ version=Version, peer=Peer, path='*', raw_qs=[]}, State);
request({http_request, _Method, _URI, _Version}, State) ->
error_terminate(501, State);
request({http_error, "\r\n"}, State) ->