Conversation
…n parsing external config properties
| */ | ||
| private static void addToMap(Map<String, String> map, String key, String value) { | ||
| if (StringUtils.isNotEmpty(value)) { | ||
| value = value.trim(); |
There was a problem hiding this comment.
@padamstx - I went ahead and added this when parsing vcap creds as well.
padamstx
left a comment
There was a problem hiding this comment.
Changes look good, I just have one question about the path segment stuff.
| String[] pathParameters = { "param1", "param2" }; | ||
| HttpUrl url = RequestBuilder.constructHttpUrl("https://myserver.com/testservice/api", pathSegments, pathParameters); | ||
| assertNotNull(url); | ||
| assertEquals("https://myserver.com/testservice/api/param1", url.toString()); |
There was a problem hiding this comment.
Could you check to see the result of this test BEFORE your fix was applied?
I'm sort of wondering whether we'd end up with a url of https://myserver.com/testservice/api/param1/param2.
I can imagine a path like "/{param1}/{param2}" which would result in "" within the pathSegments list, but {"param1", "param2" in the pathParameters list (I think). And in that case I think we'd expect the url to be https://myserver.com/testservice/api/param1/param2, wouldn't we?
I realize this might be a corner case, but I can't help myself from always bringing those up :)
There was a problem hiding this comment.
I just tested this without my changes and the result is still the same https://myserver.com/testservice/api/param1. The / most likely got added by the empty path segment, then the library saw that param1 didn't need a a / in front of it
## [8.1.4](8.1.3...8.1.4) (2020-05-01) ### Bug Fixes * trailing slash when building request urls, remove whitespace when parsing external config properties ([#77](#77)) ([57382f1](57382f1))
|
🎉 This PR is included in version 8.1.4 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
ref: https://github.ibm.com/arf/planning-sdk-squad/issues/1738, https://github.ibm.com/arf/planning-sdk-squad/issues/1742
Changes/fixes:
""are no longer added to the request url to prevent the java request url builder library from adding a/in place of the empty path segment