urunni88 opened a new pull request, #29449:
URL: https://github.com/apache/camel/pull/29449

   # Description
   
   [CAMEL-26525](https://issues.apache.org/jira/browse/CAMEL-26525): the 
request headers of `invokeFunction` came only from the 
`CamelAzureFunctionsHttpHeaders` map, so a request with a body was sent as 
`application/json` when that map had no Content-Type, even if the message had a 
`Content-Type` header (for example `text/plain`).
   
   As proposed on the JIRA, when the map has no Content-Type, the producer now 
uses the message's `Content-Type` header before the client falls back to 
`application/json`. A Content-Type set in the map still wins (checked 
case-insensitively, like the client does). The map is copied rather than 
changed, as it can be the user's own (possibly immutable) map.
   
   The `producerIn` body type description is updated (generated JSON and 
catalog copy too), and the 4.24 upgrade guide has a short note, since a route 
whose message still carries a `Content-Type` header from an earlier step now 
sends it.
   
   Tests in `FunctionsProducerInvokeTest`:
   - the message's Content-Type is used without a headers map
   - it is used when the map has no Content-Type (with an immutable `Map.of`, 
so the copy is checked too)
   - a Content-Type in the map wins over the message header
   
   The first two fail without the fix (`application/json` instead of 
`text/plain`). All 22 tests of the class pass.
   
   # Target
   
   - [x] I checked that the commit is targeting the correct branch (Camel 4 
uses the `main` branch)
   
   # Tracking
   - [x] If this is a large change, bug fix, or code improvement, I checked 
there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for 
the change (usually before you start working on it).
   
   # Apache Camel coding standards and style
   
   - [x] I checked that each commit in the pull request has a meaningful 
subject line and body.
   
   - [x] I have run `mvn clean install -DskipTests` locally from root folder 
and I have committed all auto-generated changes.
   
   # AI-assisted contributions
   
   - [x] If this PR includes AI-generated code, commits have proper 
co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR 
description identifies the AI tool used.
   
   This PR was prepared with the help of Claude (Anthropic), credited with a 
`Co-authored-by` trailer in the commit.


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