spring-cloud-aws
spring-cloud-aws copied to clipboard
Exclude Slash from Encode, when calling getURL()
:loudspeaker: Type of change
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
:scroll: Description
In the PathResourceResolver.isResourceUnderLocation method, a slash is placed in the locationPath to verify the resource. Therefore, the slash should be excluded when encoding the object name.
PathResourceResolver class : org.springframework.web.servlet.resource.PathResourceResolver
:bulb: Motivation and Context
I am using S3 to manage static resources. Using the spring, I wrote the setting code as follows.
-- application.yml spring.resources.staticLocations: - 's3://bucketName/admin/beta/'
And I registered the following Beans.
- AmazonS3
- SimpleStorageProtocolResolver
- SimpleStorageProtocolResolverConfigurer
In this environment, when I make a request such as "https://domain.com/index.html", the PathResourceResolver.isResourceUnderLocation method does not find the file correctly due to URL encoding problems.
:green_heart: How did you test it?
Modified the existing test code.
:pencil: Checklist
- [ ] I reviewed submitted code
- [x] I added tests to verify changes
- [ ] I updated reference documentation to reflect the change
- [x] All tests passing
- [x] No breaking changes
:crystal_ball: Next steps
@songintae Please sign the Contributor License Agreement!
Click here to manually synchronize the status of this Pull Request.
See the FAQ for frequently asked questions.
@songintae Please sign the Contributor License Agreement!
Click here to manually synchronize the status of this Pull Request.
See the FAQ for frequently asked questions.
@songintae Please sign the Contributor License Agreement!
Click here to manually synchronize the status of this Pull Request.
See the FAQ for frequently asked questions.
@songintae Thank you for signing the Contributor License Agreement!