Skip to content

ClassPathResource.isReadable() returns true for directory in runnable jar result in download empty file [SPR-16832] #21372

@spring-projects-issues

Description

@spring-projects-issues

Zhenbang Wei opened SPR-16832 and commented

  1. create a spring boot 2.0 project with web module
  2. create a directory src/main/resources/static/hello
  3. build a runnable jar and run it
  4. open http://localhost:8080/hello
  5. an empty file is downloaded instead of 404

This is because AbstractFileResolvingResource.isReadable() always returns true and ClassPathResource doesn't override isReadable().


Affects: 4.3.17, 5.0.6

Issue Links:

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions