You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The property server.tomcat.use-relative-redirects (backed by the field org.springframework.boot.autoconfigure.web.ServerProperties.Tomcat#useRelativeRedirects) has no declared default value. In addition to that, the code which reads the property in org.springframework.boot.autoconfigure.web.servlet.TomcatServletWebServerFactoryCustomizer#customize only applies something to the tomcat context, if an explicit value is configured.
Given this defensive approach I'd expect to get the tomcat default, if no value is configured, but this isn't the case.
org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory#prepareContext explicitly sets this to false.
I'd suggest to either
not set a value in org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory#prepareContext in order to use tomcat's default behaviour or
change the type of org.springframework.boot.autoconfigure.web.ServerProperties.Tomcat#useRelativeRedirects from Boolean(boxed) to boolean(unboxed/primitive) and make the default value of false more explicit.
Restore the `getUseRelativeRedirects` method with a `Boolean` object
result and introduce `isUseRelativeRedirects` for the primitive boolean
variant.
See gh-20796
The property
server.tomcat.use-relative-redirects
(backed by the fieldorg.springframework.boot.autoconfigure.web.ServerProperties.Tomcat#useRelativeRedirects
) has no declared default value. In addition to that, the code which reads the property inorg.springframework.boot.autoconfigure.web.servlet.TomcatServletWebServerFactoryCustomizer#customize
only applies something to the tomcat context, if an explicit value is configured.Given this defensive approach I'd expect to get the tomcat default, if no value is configured, but this isn't the case.
org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory#prepareContext
explicitly sets this to false.I'd suggest to either
org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory#prepareContext
in order to use tomcat's default behaviour ororg.springframework.boot.autoconfigure.web.ServerProperties.Tomcat#useRelativeRedirects
fromBoolean
(boxed) toboolean
(unboxed/primitive) and make the default value offalse
more explicit.see also: #10597 and #4715
The text was updated successfully, but these errors were encountered: