spring-projects / spring-boot

Spring Boot
https://spring.io/projects/spring-boot
Apache License 2.0
74.97k stars 40.65k forks source link

ResourceHttpRequestHandler 404 when encounter no english character filename , springbot 2.6.6 #30657

Closed xiaoqiaotq closed 2 years ago

xiaoqiaotq commented 2 years ago

springbot 2.6.6

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.6.6</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

config

Dingtalk_20220414143633.jpg

url path encode twice ,lead to fileResouce not found ,just need one

// test curl
curl --location --request GET 'localhost:9898/r/测试832878.tmp'

// see below pic
// first encode
测试832878.tmp   -->  %E6%B5%8B%E8%AF%95832878.tmp   
// second encode bug ??
%E6%B5%8B%E8%AF%95832878.tmp --> %25E6%25B5%258B%25E8%25AF%2595832878.tmp

Dingtalk_20220414144431.jpg

pruidong commented 2 years ago

Can't tell from the picture, I feel you should provide a minimal example.

bclozel commented 2 years ago

Closing as a duplicate of spring-projects/spring-framework#27791