mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Reinstate Tomcat’s old default behaviour for context root redirects
Prior to Tomcat 8.0.30, its default behaviour was for the mapper to redirect a request for context-root to context-root/. This redirection was switched off by default in 8.0.30 by default. This has proven to be problematic and Tomcat 8.0.31 will reinstate the old default. While we are waiting for Tomcat 8.0.31 to be released, this commit explicitly sets the default back to what it was in 8.0.29 and earlier and what it will be in 8.0.31. Closes gh-4937
This commit is contained in:
parent
2f2bba4d26
commit
43ed824f40
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2012-2015 the original author or authors.
|
* Copyright 2012-2016 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -169,6 +169,7 @@ public class TomcatEmbeddedServletContainerFactory
|
|||||||
: ClassUtils.getDefaultClassLoader());
|
: ClassUtils.getDefaultClassLoader());
|
||||||
try {
|
try {
|
||||||
context.setUseRelativeRedirects(false);
|
context.setUseRelativeRedirects(false);
|
||||||
|
context.setMapperContextRootRedirectEnabled(true);
|
||||||
}
|
}
|
||||||
catch (NoSuchMethodError ex) {
|
catch (NoSuchMethodError ex) {
|
||||||
// Tomcat is < 8.0.30. Continue
|
// Tomcat is < 8.0.30. Continue
|
||||||
|
Loading…
Reference in New Issue
Block a user