Skip to content
Permalink
Browse files
Add the Shared Address Space address range (#193)
* update private ip range

update private ip range

* Add the Shared Address Space address range
  • Loading branch information
GeraldXv authored and etrepum committed May 12, 2018
1 parent 23dc119 commit 49fbd399fc04a317eb0c62f006020c9f50bb5997
Showing 1 changed file with 8 additions and 0 deletions.
@@ -127,6 +127,14 @@ get(peer, {?MODULE, [Socket, _Opts, _Method, _RawPath, _Version, _Headers]}=THIS
Hosts ->
string:strip(lists:last(string:tokens(Hosts, ",")))
end;
%% According to RFC 6598, contributor Gerald Xv
{ok, {Addr={100, Second, _, _}, _Port}} when (Second > 63) andalso (Second < 128) ->
case get_header_value("x-forwarded-for", THIS) of
undefined ->
inet_parse:ntoa(Addr);
Hosts ->
string:strip(lists:last(string:tokens(Hosts, ",")))
end;
{ok, {Addr={192, 168, _, _}, _Port}} ->
case get_header_value("x-forwarded-for", THIS) of
undefined ->

0 comments on commit 49fbd39

Please sign in to comment.