Repository navigation
make replacements header values work like in the body - #326
Conversation
|
NetflixOSS » feign » feign-pull-requests #207 SUCCESS |
|
Please first comment on this PR. Reading through more tickets I will probably need to update Contract.processAnnotationsOnParameter() as well... |
|
NetflixOSS » feign » feign-pull-requests #208 SUCCESS |
|
... Contract.processAnnotationsOnParameter() now updated as well. |
| return false; | ||
| } | ||
|
|
||
| private static <K, V> boolean searchMapValuesAny(Map<K, Collection<String>> map, String search) { |
|
Don't expect a failure, but can you verify one of your tests cover params on a type? Otherwise, LGTM nice work! |
|
I am not sure what you mean by "params on a type". When you provide a code snippet to explain this to me, I am happy to provide a test. |
|
I meant to say Headers on type.. like this: https://github.com/Netflix/feign/blob/master/benchmark/src/main/java/feign/benchmark/FeignTestInterface.java#L11 PS update the changelog when this is all ready.. let's make this a minor bump |
|
@ahus1 if you're not available for polish by tomorrow, I will do ^^ on the way in. I like to keep the PR queue clean. |
|
NetflixOSS » feign » feign-pull-requests #209 SUCCESS |
|
@adriancole I've pushed my polished changes, please feed free to polish/change when needed. All tests are green, but I would have liked to do some canary testing .-) |
| @@ -1,5 +1,35 @@ | |||
| ### Version 8.15 | |||
| * Supports PUT without a body parameter | |||
| * Supports substitutions in @Headers like in @Body, that is with parts of the value | |||
There was a problem hiding this comment.
Please take the below text and place it into the PR description and link to that. Entries are mostly one sentence which allows folks uninterested to skip easier. Ex "supports substitutions in @Headers like in @Body. See #326
Note I escaped the @
|
If you have a moment to adjust the CHANGELOG + PR description, that would
be grand
|
|
NetflixOSS » feign » feign-pull-requests #211 SUCCESS |
|
Changelog updated. Content moved to PR description (at the very top of this discussion to make it easier to find) |
make replacements header values work like in the body
I mistakenly advised `@Headers` to follow the encoding rules of `@Body`.
This was a a mistake as in both cases, url encoding is a bad choice, if
the only goal is to prevent accidental variable expansion. For example,
url encoding interferes a lot with content, including messing with '+'
characters, such as exist in "Accept: application/vnd.github.v3+json"
This changes `@Headers` to only address the problem, which where a '{'
literal is desired in a header value. The solution offered here is to
simply repeat "{{" when you desire a '{' literal. For example, if your
header value needs to be literally "{{variable}}", you'd encode it as
"{{{{variable}}".
The impact of this change is limited to those who have already started
using v8.15, and a fast release will occur after merge to limit that.
See #326
Fixes #345
Closes #346
I mistakenly advised `@Headers` to follow the encoding rules of `@Body`.
This was a a mistake as in both cases, url encoding is a bad choice, if
the only goal is to prevent accidental variable expansion. For example,
url encoding interferes a lot with content, including messing with '+'
characters, such as exist in "Accept: application/vnd.github.v3+json"
This changes `@Headers` to only address the problem, which where a '{'
literal is desired in a header value. The solution offered here is to
simply repeat "{{" when you desire a '{' literal. For example, if your
header value needs to be literally "{{variable}}", you'd encode it as
"{{{{variable}}".
The impact of this change is limited to those who have already started
using v8.15, and a fast release will occur after merge to limit that.
See #326
Fixes #345
Closes #346
make replacements header values work like in the body
I mistakenly advised `@Headers` to follow the encoding rules of `@Body`.
This was a a mistake as in both cases, url encoding is a bad choice, if
the only goal is to prevent accidental variable expansion. For example,
url encoding interferes a lot with content, including messing with '+'
characters, such as exist in "Accept: application/vnd.github.v3+json"
This changes `@Headers` to only address the problem, which where a '{'
literal is desired in a header value. The solution offered here is to
simply repeat "{{" when you desire a '{' literal. For example, if your
header value needs to be literally "{{variable}}", you'd encode it as
"{{{{variable}}".
The impact of this change is limited to those who have already started
using v8.15, and a fast release will occur after merge to limit that.
See #326
Fixes #345
Closes #346
This tries to make replacement work in the headers like it works in the body. See #288 for a discussion. You might need to URL-encode literal values for
{or%in your existing code.Old behaviour:
New behavior
I've also added some test cases. This PR describes the behaviour I was expecting when using Headers for the first time. But it might be a breaking change for existing users, especially that curly braces now need to encoded if used literally.
Please feel free to comment and discuss, I will update the PR as necessary