Skip to content

Conversation

@ArnyminerZ
Copy link
Member

Purpose

See #791

Short description

  • Add a new client plugin that filters the Accept-Charset header before sending.

Checklist

  • The PR has a proper title, description and label.
  • I have self-reviewed the PR.
  • I have added documentation to complex functions and functions that can be used by other modules.
  • I have added reasonable tests or consciously decided to not add tests.

@ArnyminerZ ArnyminerZ self-assigned this Jan 17, 2026
@ArnyminerZ ArnyminerZ added the refactoring Quality improvement of existing functions label Jan 17, 2026
@ArnyminerZ ArnyminerZ linked an issue Jan 17, 2026 that may be closed by this pull request
@ArnyminerZ ArnyminerZ requested a review from Copilot January 17, 2026 09:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a custom Ktor client plugin to remove the Accept-Charset header from outgoing HTTP requests. This addresses compatibility issues with certain servers and aligns with RFC 9110 §12.5.2, which discourages the use of this header.

Changes:

  • Added a custom client plugin using Ktor's createClientPlugin API that intercepts outgoing requests and removes the Accept-Charset header
  • Added necessary imports for the plugin API (Send, createClientPlugin, HttpHeaders)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ArnyminerZ ArnyminerZ marked this pull request as ready for review January 17, 2026 10:26
Copy link
Member

@sunkup sunkup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Looks really good. One thing only: Right now TestAppHttpClient is in net package, but AppHttpClient is not in a net package. I think we should always put the test file for the corresponding source file in same package structure. So the structure matches.

Signed-off-by: Arnau Mora <arnyminerz@proton.me>
@ArnyminerZ ArnyminerZ requested a review from sunkup January 22, 2026 10:14
Copy link
Member

@sunkup sunkup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now. Please merge 👍

@ArnyminerZ ArnyminerZ merged commit 8918f06 into main Jan 28, 2026
5 checks passed
@ArnyminerZ ArnyminerZ deleted the 791-exclude-accept-charset-header branch January 28, 2026 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring Quality improvement of existing functions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exclude Accept-Charset header

2 participants