Languages
[Edit]
EN

Spring Boot 2 - enable encoded backslash support in path segments (\ encoding as %5C, e.g. /path/to%5Cendpoint)

9 points
Created by:
ParaEagle
724

In this short article, we would like to show how in Spring Boot 2 enable encoded backslashes support in path segments.

By default, it is not permitted to use %5C in path segments what was described here.

From Tomcat documentation:

PropertyDescription
org.apache.catalina.connector. CoyoteAdapter.ALLOW_BACKSLASHIf this is true the \ character will be permitted as a path delimiter. If not specified, the default value of false will be used.

 

Solution

Edit

It is necessary to set:

In the below, we use used System.setProperty() to set the above flag:

It is necessary to add path match configuration:

See also

Edit
  1. Spring Boot 2 - request mapping with wildcard parameter (/path/**)

  2. Spring Boot 2 - enable encoded slash support in path segments (/ encoding as %2F, e.g. /path/to%2Fendpoint)

Alternative titles

  1. Spring Boot 2 - allow encoded backslash support in path segments
  2. Spring Boot 2 - allow to use %5C in paths
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join