Skip to content

Commit cdf785a

Browse files
committed
Fix index.html root path forwarding
Fix automatic '/' -> 'index.html' forwarding to also work when a `server.servlet-path` property is set. Fixes gh-2351
1 parent 0484e5c commit cdf785a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ private void addStaticIndexHtmlViewControllers(ViewControllerRegistry registry)
281281
// Ignore
282282
}
283283
// Use forward: prefix so that no view resolution is done
284-
registry.addViewController("/").setViewName("forward:/index.html");
284+
registry.addViewController("/").setViewName("forward:index.html");
285285
return;
286286
}
287287
}

0 commit comments

Comments
 (0)