allthingssecurity commented on PR #27690:
URL: https://github.com/apache/camel/pull/27690#issuecomment-6115894511

   A correction to what I wrote in this PR. The description and the upgrade 
guide note said that the fix sends one HTTP
   header per value "as camel-http does". That is wrong: 
`HttpProducer.applyHeader` of camel-http sends two or more
   values as one header in the form `[a, b]`, on purpose (its comment says so), 
and only a single value as is.
   camel-netty-http (`DefaultNettyHttpBinding.toNettyRequest`) and 
camel-undertow
   (`DefaultUndertowHttpBinding.toHttpRequest`) do send one header per value. 
So the HTTP producers are not uniform, and
   this PR aligns camel-knative-http with netty-http and undertow, not with 
camel-http.
   
   632bb7932918 corrects the wording of the upgrade guide note and adds the 
same statement to the test javadoc (no code
   change; 187 tests, 0 failures), and the description now has a correction 
paragraph at the top. The message of the
   first commit still has the wrong sentence; I did not rewrite history, please 
ignore it or fix it when squashing.
   
   The sentence and the tests added in fcbdefac2415 for an empty collection (an 
empty List, an empty `Object[]` or a List
   with only null values sends no header) are not affected: camel-http, 
camel-netty-http and camel-undertow send no header
   for such a value either, and the note now names all three.
   
   What stays true whatever the convention: on main the reply of the consumer 
sends only the last value of a List header
   (`putHeader` per value replaces the header), a `byte[]` header is sent as 
`[B@...` by the producer and as its last
   byte by the reply, and a `String[]` header is sent as 
`[Ljava.lang.String;@...`.
   
   Which convention do you want for the producer? If the `[a, b]` form of 
camel-http is the intended one for HTTP
   producers (CAMEL-4212 introduced it, and CAMEL-11662 asked to change it for 
camel-ahc and was closed as Won't Fix),
   the List part of the producer change should be dropped and I would reduce 
this PR to the reply, `byte[]` and array
   cases, or close it if you prefer. If one header per value is preferred, the 
PR can stay as it is. I am fine with
   either.
   
   _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