You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Adding URI segment specific encoding
Fixes#879
URI encoding introduced in Feign 10.x was refactored to be more in line
with URI and URI Template specifications respectively. One change was to
ensure that certain reserved characters were not encoded incorrectly.
The result was that path segment specific reserved characters were being
preserved on the query string as well. This change updates the `UriTemplate`
and `Expression` classes to recognize the segment of the URI that is being processed
and apply the segment specific encoding correctly.
One important change regarding the `+` sign. Per the URI specification, a `+` sign
is allowed in both the path and query segments of a URI, however, handling of
the symbol on the query can be inconsistent. In some legacy systems, the `+` is
equivalent to the a space. Feign takes the approach of modern systems, where a
`+` symbol should not reprsent a space and is explicitly encoded as `%2B` when
found on a query string.
If you wish to use `+` as a space, then use the literal ` ` character or encode
the value directly as `%20`
Copy file name to clipboardExpand all lines: README.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -113,6 +113,14 @@ See [Advanced Usage](#advanced-usage) for more examples.
113
113
>
114
114
> `@RequestLine` and `@QueryMap` templates do not encode slash `/` characters by default. To change this behavior, set the `decodeSlash` property on the `@RequestLine` to `false`.
115
115
116
+
> **What about plus? `+`**
117
+
>
118
+
> Per the URI specification, a `+` sign is allowed in both the path and query segments of a URI, however, handling of
119
+
> the symbol on the query can be inconsistent. In some legacy systems, the `+` is equivalent to the a space. Feign takes the approach of modern systems, where a
120
+
> `+` symbol should not represent a space and is explicitly encoded as `%2B` when found on a query string.
121
+
>
122
+
> If you wish to use `+` as a space, then use the literal `` character or encode the value directly as `%20`
123
+
116
124
##### Custom Expansion
117
125
118
126
The `@Param` annotation has an optional property `expander` allowing for complete control over the individual parameter's expansion.
0 commit comments