diff options
author | Yurii Rashkovskii <[email protected]> | 2012-01-04 15:13:14 -0800 |
---|---|---|
committer | Yurii Rashkovskii <[email protected]> | 2012-01-04 15:13:14 -0800 |
commit | ade1fb93cae093c5bb58e9ad6fdd50b1450cce21 (patch) | |
tree | 5816c690fb3940b14d4c118e02c2b51573a4cd86 | |
parent | 5c101560dfffe56c3d27b430761145faefb73405 (diff) | |
download | cowboy-ade1fb93cae093c5bb58e9ad6fdd50b1450cce21.tar.gz cowboy-ade1fb93cae093c5bb58e9ad6fdd50b1450cce21.tar.bz2 cowboy-ade1fb93cae093c5bb58e9ad6fdd50b1450cce21.zip |
inet_address:parse/1 does not accept binaries as an input, only strings
-rw-r--r-- | src/cowboy_http_req.erl | 4 |
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}. |