Class ServletRequestUtils
java.lang.Object
org.onehippo.forge.content.exim.repository.jaxrs.util.ServletRequestUtils
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic String
getFarthestRemoteAddr
(jakarta.servlet.http.HttpServletRequest request) Returns the remote client address.static String[]
getRemoteAddrs
(jakarta.servlet.http.HttpServletRequest request) Returns the remote host addresses related to this request.
-
Field Details
-
DEFAULT_HTTP_FORWARDED_FOR_HEADER
Default HTTP Forwarded-For header name.X-Forwarded-For
by default.- See Also:
-
HTTP_FORWARDED_FOR_HEADER_PARAM
Servlet context init parameter name for custom HTTP Forwarded-For header name. If not set,DEFAULT_HTTP_FORWARDED_FOR_HEADER
is used by default.- See Also:
-
-
Method Details
-
getRemoteAddrs
Returns the remote host addresses related to this request. If there's any proxy server between the client and the server, then the proxy addresses are contained in the returned array. The lowest indexed element is the farthest downstream client and each successive proxy addresses are the next elements.- Parameters:
request
- servlet request- Returns:
- the remote host addresses related to this request
-
getFarthestRemoteAddr
Returns the remote client address.- Parameters:
request
- servlet request- Returns:
- the remote client address
-