mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-27 06:12:27 +00:00
SEC-187: Tidy up URL composition logic basedon default HTTP(S) ports.
This commit is contained in:
parent
307ac99ec5
commit
f6b7429947
@ -98,11 +98,9 @@ public class AuthenticationProcessingFilterEntryPoint
|
|||||||
|
|
||||||
boolean includePort = true;
|
boolean includePort = true;
|
||||||
|
|
||||||
if ("http".equals(scheme.toLowerCase()) && (serverPort == 80)) {
|
if (inHttp && (serverPort == 80)) {
|
||||||
includePort = false;
|
includePort = false;
|
||||||
}
|
} else if (inHttps && (serverPort == 443)) {
|
||||||
|
|
||||||
if ("https".equals(scheme.toLowerCase()) && (serverPort == 443)) {
|
|
||||||
includePort = false;
|
includePort = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,8 +109,8 @@ public class AuthenticationProcessingFilterEntryPoint
|
|||||||
+ loginFormUrl;
|
+ loginFormUrl;
|
||||||
|
|
||||||
if (forceHttps && inHttp) {
|
if (forceHttps && inHttp) {
|
||||||
Integer httpPort = new Integer(portResolver.getServerPort(request));
|
Integer httpsPort = (Integer) portMapper.lookupHttpsPort(new Integer(
|
||||||
Integer httpsPort = (Integer) portMapper.lookupHttpsPort(httpPort);
|
serverPort));
|
||||||
|
|
||||||
if (httpsPort != null) {
|
if (httpsPort != null) {
|
||||||
if (httpsPort.intValue() == 443) {
|
if (httpsPort.intValue() == 443) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user