Class XForwardedForUtil
java.lang.Object
com.atlassian.crowd.manager.validation.XForwardedForUtil
Utility class for handling the X-Forwarded-For (XFF) HTTP request header.
- Since:
- 2.2
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getTrustedAddress
(TrustedProxyManager trustedProxyManager, String requestAddress, String xForwardedFor) Returns the originating client address the proxies are forwarding for if all the proxies are trusted, otherwise, return the request address.static InetAddress
getTrustedAddress
(TrustedProxyManager trustedProxyManager, javax.servlet.http.HttpServletRequest request) Returns the originating client address the proxies are forwarding for if the proxies are trusted, otherwise, return the request address.
-
Method Details
-
getTrustedAddress
public static InetAddress getTrustedAddress(TrustedProxyManager trustedProxyManager, javax.servlet.http.HttpServletRequest request) Returns the originating client address the proxies are forwarding for if the proxies are trusted, otherwise, return the request address.- Parameters:
trustedProxyManager
- used to determine if the proxy address is trustedrequest
- HTTP request- Returns:
- originating client address if the proxies are trusted, otherwise, the request address is returned
-
getTrustedAddress
public static String getTrustedAddress(TrustedProxyManager trustedProxyManager, String requestAddress, String xForwardedFor) Returns the originating client address the proxies are forwarding for if all the proxies are trusted, otherwise, return the request address.- Parameters:
trustedProxyManager
- used to determine if the proxy address is trustedrequestAddress
- HTTP request addressxForwardedFor
- X-Forwarded-For header- Returns:
- originating client address if the proxies are trusted, otherwise, the request address is returned
-