Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

candrews
Copy link
Contributor

@candrews candrews commented Nov 1, 2018

Fixes gh-3259

@codecov-io
Copy link

codecov-io commented Nov 1, 2018

Codecov Report

Merging #3262 into master will increase coverage by 0.49%.
The diff coverage is 88.88%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3262      +/-   ##
============================================
+ Coverage     65.46%   65.95%   +0.49%     
- Complexity     1475     1478       +3     
============================================
  Files           188      188              
  Lines          6943     6949       +6     
  Branches        846      849       +3     
============================================
+ Hits           4545     4583      +38     
+ Misses         2085     2052      -33     
- Partials        313      314       +1
Impacted Files Coverage Δ Complexity Δ
...cloud/netflix/zuul/ZuulProxyAutoConfiguration.java 80.76% <100%> (+3.49%) 9 <4> (+2) ⬆️
...loud/netflix/zuul/ZuulServerAutoConfiguration.java 75.51% <66.66%> (-1.09%) 16 <1> (ø)
...cloud/netflix/eureka/EurekaInstanceConfigBean.java 69.03% <0%> (+16.75%) 54% <0%> (+1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6859b7a...d815bb5. Read the comment docs.

@spencergibb
Copy link
Member

How about a test?

@ryanjbaxter
Copy link
Contributor

Ping @candrews, could you add a test?

@@ -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 = "";
Copy link
Member

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.

@@ -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 = "";
Copy link
Member

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.

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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ryanjbaxter
Copy link
Contributor

Ping @candrews care to continue working on this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants