From 113abbe6e6d81b12081cbc8934b115e3b22fa6fc Mon Sep 17 00:00:00 2001 From: Nishant Raut <10669557+nishantraut@users.noreply.github.com> Date: Sat, 27 Oct 2018 15:22:21 +0530 Subject: [PATCH 1/2] Improve Path Matching and Content Negotiation docs Add a note to the "Path Matching and Content Negotiation" section about the `spring.mvc.pathmatch.use-suffix-pattern` property. Closes gh-14977 --- .../src/main/asciidoc/spring-boot-features.adoc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc index 1ca1781d8d1..4fa79245b4c 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -2258,6 +2258,9 @@ suffix pattern matching, the following configuration is required: ---- spring.mvc.contentnegotiation.favor-path-extension=true + #Whether to use suffix pattern match (".*") when matching patterns to requests + spring.mvc.pathmatch.use-suffix-pattern=true + # You can also restrict that feature to known extensions only # spring.mvc.pathmatch.use-registered-suffix-pattern=true From 43dd3cfa760621ab74e33e0911f9ae98b5a2b98e Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Sun, 28 Oct 2018 08:59:30 -0700 Subject: [PATCH 2/2] Polish "Improve Path Matching and Content Negotiation docs" See gh-14977 --- .../src/main/asciidoc/spring-boot-features.adoc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc index 4fa79245b4c..61e2e12e2ed 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -2257,18 +2257,23 @@ suffix pattern matching, the following configuration is required: [source,properties,indent=0,subs="verbatim,quotes,attributes"] ---- spring.mvc.contentnegotiation.favor-path-extension=true - - #Whether to use suffix pattern match (".*") when matching patterns to requests spring.mvc.pathmatch.use-suffix-pattern=true +---- - # You can also restrict that feature to known extensions only - # spring.mvc.pathmatch.use-registered-suffix-pattern=true +Alternatively, rather than open all suffix patterns, it's more secure to just support +registered suffix patterns: - # We can also register additional file extensions/media types with: +[source,properties,indent=0,subs="verbatim,quotes,attributes"] +---- + spring.mvc.contentnegotiation.favor-path-extension=true + spring.mvc.pathmatch.use-registered-suffix-pattern=true + + # You can also register additional file extensions/media types with: # spring.mvc.contentnegotiation.media-types.adoc=text/asciidoc ---- + [[boot-features-spring-mvc-web-binding-initializer]] ==== ConfigurableWebBindingInitializer Spring MVC uses a `WebBindingInitializer` to initialize a `WebDataBinder` for a