Skip to content
Snippets Groups Projects
Commit d410f1ca authored by Kirti Kanchan's avatar Kirti Kanchan Committed by Neelesh Thakur
Browse files

Merged PR 30271: Issues after upgrading to spring6 : Trailing slashes changes

Changes for trailing slashes

(cherry picked from commit 5c444ad93e1d98781e72939dff41f754f67a0746)
parent 61eb3532
No related branches found
No related tags found
1 merge request!485Issues after upgrading to spring6 : Trailing slashes changes
Pipeline #282581 failed
package org.opengroup.osdu.dataset.configuration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.web.firewall.HttpFirewall;
import org.springframework.security.web.firewall.StrictHttpFirewall;
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.util.UrlPathHelper;
@Configuration
public class SpringWebMvcConfiguration implements WebMvcConfigurer {
@Bean
public HttpFirewall allowUrlEncodedSlashHttpFirewall() {
StrictHttpFirewall firewall = new StrictHttpFirewall();
firewall.setAllowUrlEncodedSlash(true);
firewall.setAllowUrlEncodedPercent(true);
return firewall;
}
@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
UrlPathHelper urlPathHelper = new UrlPathHelper();
urlPathHelper.setUrlDecode(false);
configurer.setUrlPathHelper(urlPathHelper);
configurer.setUseTrailingSlashMatch(true);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment