gnodet-bot commented on code in PR #27787:
URL: https://github.com/apache/camel/pull/27787#discussion_r4259852468
##########
components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java:
##########
@@ -211,10 +210,8 @@ public void process(Exchange exchange) throws Exception {
continue;
}
- // use an iterator as there can be multiple values.
(must not use a delimiter, and allow empty values)
- final Iterator<?> it =
ObjectHelper.createIterator(headerValue, null, true);
-
- HttpUtil.applyHeader(strategy, exchange, it, tc, key,
+ // a collection or an object array is sent as one
header per value; any other value is a single header
Review Comment:
💡 **Suggestion:** The comment accurately describes the new behavior for
`Collection` and arrays, but it silently changes behavior for
**non-`Collection` `Iterable`** values. The old code used
`ObjectHelper.createIterator` which handled arbitrary `Iterable` instances
element-by-element; the new `HttpUtil.applyHeaderValue` treats non-`Collection`
`Iterables` as a single scalar (converts to `String`). Consider noting this for
callers:
```suggestion
// a Collection or an object array is sent as one
header per value;
// any other value (including non-Collection
Iterables) is a single header
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]