Skip to content

Omit Content-Type value from Apache 5 client warning - #7589

Open
davidh44 wants to merge 2 commits into
masterfrom
hdavidh/omit-content-type-warning
Open

davidh44 wants to merge 2 commits into
masterfrom
hdavidh/omit-content-type-warning

Conversation

@davidh44

Copy link
Copy Markdown
Contributor

Changes

Stop including the Content-Type header value and the parse exception in the warning logged when the Apache 5 HTTP client cannot parse it.

Motivation and Context

Modifications

Testing

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance improvement (non-breaking change which improves latency, throughput, or resource use)
  • Deprecation (marks existing functionality as deprecated)
  • Removal (removes previously deprecated functionality)
  • Documentation (changes to documentation only)
  • Other (tests, build, CI, or refactoring with no customer-visible change)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed
  • I have added a changelog entry. Adding a new entry must be accomplished by running the scripts/new-change script and following the instructions. Commit the new file created by the script in .changes/next-release with your changes.
  • My change is to implement 1.11 parity feature and I have updated LaunchChangelog

AI tools

  • I wrote this pull request description myself, not with an AI tool
  • I have reviewed all changes in this pull request myself, including any generated by AI tools

License

  • I confirm that this pull request can be released under the Apache 2 license

## Changes

1. Log a fixed warning message when the Apache 5 HTTP client cannot parse the request's Content-Type header, without the header value or the parse exception.
2. Send the request with no parsed content type, as before.
3. Add a parameterized unit test that passes three unparseable Content-Type values and checks that the client does not throw, the entity has no content type, a WARN containing "Unable to parse" is logged, and no logged event contains the value or an attached exception.
4. Add a changelog entry for the Apache 5 HTTP Client.
@davidh44
davidh44 requested a review from a team as a code owner November 25, 2026 23:14

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant