Skip to content

Commit daed512

Browse files
committed
Restore getUseRelativeRedirects in deprecated form
Restore the `getUseRelativeRedirects` method with a `Boolean` object result and introduce `isUseRelativeRedirects` for the primitive boolean variant. See gh-20796
1 parent 5157a75 commit daed512

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,12 @@ public void setRedirectContextRoot(Boolean redirectContextRoot) {
537537
this.redirectContextRoot = redirectContextRoot;
538538
}
539539

540-
public boolean getUseRelativeRedirects() {
540+
@Deprecated
541+
public Boolean getUseRelativeRedirects() {
542+
return this.useRelativeRedirects;
543+
}
544+
545+
public boolean isUseRelativeRedirects() {
541546
return this.useRelativeRedirects;
542547
}
543548

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/TomcatServletWebServerFactoryCustomizer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void customize(TomcatServletWebServerFactory factory) {
5454
if (tomcatProperties.getRedirectContextRoot() != null) {
5555
customizeRedirectContextRoot(factory, tomcatProperties.getRedirectContextRoot());
5656
}
57-
customizeUseRelativeRedirects(factory, tomcatProperties.getUseRelativeRedirects());
57+
customizeUseRelativeRedirects(factory, tomcatProperties.isUseRelativeRedirects());
5858
factory.setDisableMBeanRegistry(!tomcatProperties.getMbeanregistry().isEnabled());
5959
}
6060

0 commit comments

Comments
 (0)