spring-cloud / spring-cloud/spring-cloud-config
Config server - native profile - relative path denied by GenericResourceRepository
@ryanjbaxter is already working on this.
Since Jul 27, 2020.
- Dominant language
- Java
- Stars
- 2k
- Forks
- 1.3k
- Avg merge
- 2d 59m
- Merged PRs (30d)
- 16
Description
Describe the bug
Using relative path in seachLocations for native profile of Config server:
spring:
profiles: native
cloud:
config:
server:
native:
searchLocations: ../../config/localhost
Everything seems fine - get properties works correctly:
GET https://localhost:8888/config/app-name/default
..returns correctly properties. See log:
[nio-8888-exec-5] o.s.c.c.s.e.NativeEnvironmentRepository : [] Adding property source: file:../../config/localhost/application.properties
But when trying to obtain any other resource file, we got validation error from GenericResourceRepository:
GET https://localhost:8888/config/app-name/default/default/some-file.xml
[nio-8888-exec-9] o.s.c.c.s.r.GenericResourceRepository : [] Location contains ".."
I assume this is a buggy behaviour - Eighter path should be normalized (canonical path) before full path is constructed with reuest file or only requested part of path should be checked.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.