tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Make the InetAddress object available via ServletRequest?
Date Mon, 10 Oct 2011 20:20:53 GMT
Francis,

On 10/9/2011 10:57 AM, Francis Galiegue wrote:
> I have my CIDR matching valve/filter ready (still struggling to write
> unit tests, but it works in real-world situations), and there is
> something I find quite unoptimized: you have getRemoteHost() and
> getRemoteAddr() to get the remote host name and IP addresses as
> strings, but why can't you get hold of the InetAddress object
> directly?

Aside from Mark's excellent response, there are ways to modify or mask
the IP or host name of the remote host, and creating additional
InetAddress objects and possibly performing additional reverse-DNS
lookups for such objects would be a waste of time (though they could
probably be done lazily).

-chris


Mime
View raw message