mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-03-01 10:59:16 +00:00
Remove unnecessary parentheses and add static final field
This commit is contained in:
parent
346d479efb
commit
8f1c892fb7
@ -24,9 +24,12 @@ import org.springframework.security.web.PortResolver;
|
|||||||
* Always returns the constructor-specified HTTP and HTTPS ports.
|
* Always returns the constructor-specified HTTP and HTTPS ports.
|
||||||
*
|
*
|
||||||
* @author Ben Alex
|
* @author Ben Alex
|
||||||
|
* @author nomoreFt
|
||||||
*/
|
*/
|
||||||
public class MockPortResolver implements PortResolver {
|
public class MockPortResolver implements PortResolver {
|
||||||
|
|
||||||
|
private static final String HTTPS_SCHEME = "https";
|
||||||
|
|
||||||
private int http = 80;
|
private int http = 80;
|
||||||
|
|
||||||
private int https = 443;
|
private int https = 443;
|
||||||
@ -38,7 +41,7 @@ public class MockPortResolver implements PortResolver {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getServerPort(ServletRequest request) {
|
public int getServerPort(ServletRequest request) {
|
||||||
if ((request.getScheme() != null) && request.getScheme().equals("https")) {
|
if (request.getScheme() != null && HTTPS_SCHEME.equals(request.getScheme())) {
|
||||||
return this.https;
|
return this.https;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user