allthingssecurity commented on code in PR #27689:
URL: https://github.com/apache/camel/pull/27689#discussion_r4243907312


##########
components/camel-vertx/camel-vertx-http/src/main/java/org/apache/camel/component/vertx/http/DefaultVertxHttpBinding.java:
##########
@@ -138,7 +140,18 @@ public void populateRequestHeaders(
                     continue;
                 }
 
-                if (!strategy.applyFilterToCamelHeaders(key, headerValue, 
exchange)) {
+                if (headerValue instanceof Iterable || headerValue instanceof 
Object[]) {
+                    // a collection or an object array has one value per 
element (must not use a delimiter, and allow
+                    // empty values); any other value, also a byte[] or 
another primitive array, is a single value
+                    final Iterator<?> it = 
org.apache.camel.support.ObjectHelper.createIterator(headerValue, null, true);
+                    HttpUtil.applyHeader(strategy, exchange, it, tc, key, 
(multiValues, prev) -> {
+                        if (multiValues != null) {
+                            headers.set(key, multiValues);
+                        } else if (prev != null) {
+                            headers.set(key, prev);

Review Comment:
   Confirmed, and added in 2178e3b1f99a. An empty `Iterable`, an empty 
`Object[]` and a collection with only null values
   now send no header; with the binding of main the three new tests fail with 
`[]`, `[Ljava.lang.Object;@...` and
   `[null, null]` as the header value. `VertxHttpMultiValueHeaderTest` has a 
test for each of the three cases (header not
   sent), and the upgrade guide note has one more sentence about it. For such a 
value camel-http, camel-netty-http and
   camel-undertow send no header either (nothing is added when the iterator 
gives no non-null value); this is the only
   point where the note compares with camel-http, see the correction in the 
summary comment for values of two or more.
   camel-vertx-http: 104 tests, 0 failures, 1 skipped as on main.
   
   The sibling PR #27690 (camel-knative-http) has the same value handling; I 
added the same tests and sentence there
   (fcbdefac2415).
   
   _Claude Code on behalf of allthingssecurity_



-- 
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]

Reply via email to