aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_http_req.erl
diff options
context:
space:
mode:
authorYurii Rashkovskii <[email protected]>2012-01-04 15:13:14 -0800
committerYurii Rashkovskii <[email protected]>2012-01-04 15:13:14 -0800
commitade1fb93cae093c5bb58e9ad6fdd50b1450cce21 (patch)
tree5816c690fb3940b14d4c118e02c2b51573a4cd86 /src/cowboy_http_req.erl
parent5c101560dfffe56c3d27b430761145faefb73405 (diff)
downloadcowboy-ade1fb93cae093c5bb58e9ad6fdd50b1450cce21.tar.gz
cowboy-ade1fb93cae093c5bb58e9ad6fdd50b1450cce21.tar.bz2
cowboy-ade1fb93cae093c5bb58e9ad6fdd50b1450cce21.zip
inet_address:parse/1 does not accept binaries as an input, only strings
Diffstat (limited to 'src/cowboy_http_req.erl')
-rw-r--r--src/cowboy_http_req.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cowboy_http_req.erl b/src/cowboy_http_req.erl
index 057ea4d..7a0e3a7 100644
--- a/src/cowboy_http_req.erl
+++ b/src/cowboy_http_req.erl
@@ -89,8 +89,8 @@ peer_addr(Req = #http_req{}) ->
end
end,
{ok, PeerAddr} = if
- is_binary(RealIp) -> inet_parse:address(RealIp);
- is_binary(ForwardedFor) -> inet_parse:address(ForwardedFor);
+ is_binary(RealIp) -> inet_parse:address(binary_to_list(RealIp));
+ is_binary(ForwardedFor) -> inet_parse:address(binary_to_list(ForwardedFor));
true -> {ok, PeerIp}
end,
{PeerAddr, Req3}.