diff options
author | Loïc Hoguin <[email protected]> | 2011-03-20 15:10:58 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2011-03-20 15:10:58 +0100 |
commit | a3fff2f5b0bc55b1996a49a57cfecc31220b1175 (patch) | |
tree | b69142f9e4bc17729f7200775d6eaf0df3f0a7cc /src/cowboy_http_protocol.erl | |
parent | df35916d2a84c0c5097b2ff9236aa3432a92f675 (diff) | |
download | cowboy-a3fff2f5b0bc55b1996a49a57cfecc31220b1175.tar.gz cowboy-a3fff2f5b0bc55b1996a49a57cfecc31220b1175.tar.bz2 cowboy-a3fff2f5b0bc55b1996a49a57cfecc31220b1175.zip |
Rename a variable in cowboy_http_protocol for clarity.
Diffstat (limited to 'src/cowboy_http_protocol.erl')
-rw-r--r-- | src/cowboy_http_protocol.erl | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cowboy_http_protocol.erl b/src/cowboy_http_protocol.erl index 423c641..3e4116c 100644 --- a/src/cowboy_http_protocol.erl +++ b/src/cowboy_http_protocol.erl @@ -97,17 +97,17 @@ wait_header(Req, State=#state{socket=Socket, -spec header({http_header, I::integer(), Field::http_header(), R::term(), Value::string()} | http_eoh, Req::#http_req{}, State::#state{}) -> ok. -header({http_header, _I, 'Host', _R, Value}, Req=#http_req{path=Path, +header({http_header, _I, 'Host', _R, RawHost}, Req=#http_req{path=Path, host=undefined}, State=#state{dispatch=Dispatch}) -> - Value2 = string:to_lower(Value), - Host = cowboy_dispatcher:split_host(Value2), + RawHost2 = string:to_lower(RawHost), + Host = cowboy_dispatcher:split_host(RawHost2), %% @todo We probably want to filter the Host and Path here to allow %% things like url rewriting. case cowboy_dispatcher:match(Host, Path, Dispatch) of {ok, Handler, Opts, Binds} -> wait_header(Req#http_req{ - host=Host, raw_host=Value2, bindings=Binds, - headers=[{'Host', Value2}|Req#http_req.headers]}, + host=Host, raw_host=RawHost2, bindings=Binds, + headers=[{'Host', RawHost2}|Req#http_req.headers]}, State#state{handler={Handler, Opts}}); {error, notfound, host} -> error_terminate(400, State); |