diff options
author | Loïc Hoguin <[email protected]> | 2011-03-20 00:01:29 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2011-03-20 00:01:29 +0100 |
commit | b874b28561e0e3d626245dee91ac44ad4d8218f1 (patch) | |
tree | a548f609376a0cdde3dfa0e5c00290f5c965720e /src/cowboy_http_protocol.erl | |
parent | 8085529f48dd3a19baf5a4218d462e0afcfedbf9 (diff) | |
download | cowboy-b874b28561e0e3d626245dee91ac44ad4d8218f1.tar.gz cowboy-b874b28561e0e3d626245dee91ac44ad4d8218f1.tar.bz2 cowboy-b874b28561e0e3d626245dee91ac44ad4d8218f1.zip |
Save the raw path string in the request.
Diffstat (limited to 'src/cowboy_http_protocol.erl')
-rw-r--r-- | src/cowboy_http_protocol.erl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/cowboy_http_protocol.erl b/src/cowboy_http_protocol.erl index 0c7c2c7..1392ea1 100644 --- a/src/cowboy_http_protocol.erl +++ b/src/cowboy_http_protocol.erl @@ -64,15 +64,16 @@ request({http_request, _Method, _URI, Version}, State) %% @todo We need to cleanup the URI properly. request({http_request, Method, {abs_path, AbsPath}, Version}, State=#state{socket=Socket, transport=Transport}) -> - {Path, Qs} = cowboy_dispatcher:split_path(AbsPath), + {Path, RawPath, Qs} = cowboy_dispatcher:split_path(AbsPath), {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); + version=Version, peer=Peer, path=Path, raw_path=RawPath, 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); + version=Version, peer=Peer, path='*', raw_path="*", raw_qs=[]}, State); request({http_request, _Method, _URI, _Version}, State) -> error_terminate(501, State); request({http_error, "\r\n"}, State) -> |