spring-boot:2.6.7 spring-webmvc:5.3.19

I have configured access to local static resources

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/image1/**").addResourceLocations("file:D:\\Data\\TD\\image1\\");
    }

When I request a path: http://localhost:8080/image1/P/test%20simple.jpg Prompt 404 Not Found

Was found during debugging org.springframework.web.servlet.resource.PathResourceResolver#encodeOrDecodeIfNecessary

The code here will change the URI to: P/test%2520simple.jpg

The code is org.springframework.web.servlet.resource.PathResourceResolver on line 157

The pathToUse variable becomes P/test%2520simple.jpg

Comment From: bclozel

Duplicates #27791