spring-cloud-config icon indicating copy to clipboard operation
spring-cloud-config copied to clipboard

Retrieving formatted/resolved properties returns manipulated value

Open marnee01 opened this issue 8 months ago • 0 comments

Describe the bug If a client app, e.g. "TestApp" has a TestApp.properties file containing properties such as:

Root=${env:LOCAL_Root/-c:/vueroot}

And then if you call {CONFIG-SERVER-URL}/dev/TestApp-dev.properties, the Root property is returned as:

Root: LOCAL_Root/-c:/vueroot

I'm not sure what the expected behavior is here, or what rule is being applied to modify it as such. There may not be a defect, but what I would expect is that it would return the value exactly as defined in the .properties file:

Root=${env:LOCAL_Root/-c:/vueroot}

I did not find any documentation that would indicate this property is utilizing some config server feature, and thus would explain the observed behavior.

Note that this also occurs if you use the "yml" or "json" format instead of "properties" in the request.

Sample Here is a project that demonstrates the issues. The "TestApp.properties" file is under the resources/config folder. ResolvePropertiesConfigServer2.zip

  1. Unzip the app.
  2. Run the app as usual
  3. Send request: http://localhost:8080/dev/TestApp-dev.properties, http://localhost:8080/dev/TestApp-dev.yml, or http://localhost:8080/dev/TestApp-dev.json

Observe the manipulated value of the "Root" property.

marnee01 avatar May 28 '24 22:05 marnee01