Package org.springframework.security.web
Class PortResolverImpl
- java.lang.Object
-
- org.springframework.security.web.PortResolverImpl
-
- All Implemented Interfaces:
PortResolver
public class PortResolverImpl extends java.lang.Object implements PortResolver
Concrete implementation ofPortResolver
that obtains the port from ServletRequest.getServerPort().This class is capable of handling the IE bug which results in an incorrect URL being presented in the header subsequent to a redirect to a different scheme and port where the port is not a well-known number (ie 80 or 443). Handling involves detecting an incorrect response from
ServletRequest.getServerPort()
for the scheme (eg a HTTP request on 8443) and then determining the real server port (eg HTTP request is really on 8080). The map of valid ports is obtained from the configuredPortMapper
.
-
-
Constructor Summary
Constructors Constructor Description PortResolverImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PortMapper
getPortMapper()
int
getServerPort(javax.servlet.ServletRequest request)
Indicates the port theServletRequest
was received on.void
setPortMapper(PortMapper portMapper)
-
-
-
Method Detail
-
getPortMapper
public PortMapper getPortMapper()
-
getServerPort
public int getServerPort(javax.servlet.ServletRequest request)
Description copied from interface:PortResolver
Indicates the port theServletRequest
was received on.- Specified by:
getServerPort
in interfacePortResolver
- Parameters:
request
- that the method should lookup the port for- Returns:
- the port the request was received on
-
setPortMapper
public void setPortMapper(PortMapper portMapper)
-
-