-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add null checks for org.springframework.boot.autoconfigure.web.ServerProperties.Servlet#getContextPath() #3262
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,15 +89,19 @@ public HasFeatures zuulFeature() { | |
@Bean | ||
@ConditionalOnMissingBean(DiscoveryClientRouteLocator.class) | ||
public DiscoveryClientRouteLocator discoveryRouteLocator() { | ||
return new DiscoveryClientRouteLocator(this.server.getServlet().getContextPath(), this.discovery, this.zuulProperties, | ||
String contextPath = this.server.getServlet().getContextPath(); | ||
if(contextPath == null) contextPath = ""; | ||
return new DiscoveryClientRouteLocator(contextPath, this.discovery, this.zuulProperties, | ||
this.serviceRouteMapper, this.registration); | ||
} | ||
|
||
// pre filters | ||
@Bean | ||
@ConditionalOnMissingBean(PreDecorationFilter.class) | ||
public PreDecorationFilter preDecorationFilter(RouteLocator routeLocator, ProxyRequestHelper proxyRequestHelper) { | ||
return new PreDecorationFilter(routeLocator, this.server.getServlet().getContextPath(), this.zuulProperties, | ||
String contextPath = this.server.getServlet().getContextPath(); | ||
if(contextPath == null) contextPath = ""; | ||
return new PreDecorationFilter(routeLocator, contextPath, this.zuulProperties, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be removed and a |
||
proxyRequestHelper); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,7 +106,9 @@ public CompositeRouteLocator primaryRouteLocator( | |
@Bean | ||
@ConditionalOnMissingBean(SimpleRouteLocator.class) | ||
public SimpleRouteLocator simpleRouteLocator() { | ||
return new SimpleRouteLocator(this.server.getServlet().getContextPath(), | ||
String contextPath = this.server.getServlet().getContextPath(); | ||
if(contextPath == null) contextPath = ""; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not needed and out of scope for this PR. |
||
return new SimpleRouteLocator(contextPath, | ||
this.zuulProperties); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not needed and out of scope for this PR.