Skip to content

fix: Fix ktor headers#767

Merged
benjaminVadon merged 6 commits into
mainfrom
fix-ktor-headers
May 18, 2026
Merged

fix: Fix ktor headers#767
benjaminVadon merged 6 commits into
mainfrom
fix-ktor-headers

Conversation

@benjaminVadon
Copy link
Copy Markdown
Contributor

No description provided.

@benjaminVadon benjaminVadon requested a review from tevincent May 18, 2026 09:29
@benjaminVadon benjaminVadon self-assigned this May 18, 2026
Copilot AI review requested due to automatic review settings May 18, 2026 09:29
Copy link
Copy Markdown

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 aims to fix/standardize header configuration for Ktor-based HTTP clients by centralizing common header construction in HttpUtils and reusing it from Ktor defaultRequest blocks.

Changes:

  • Refactors HttpUtils.getHeaders() to build headers from a shared map and adds a Ktor HeadersBuilder.setHeaders() helper.
  • Updates Ktor clients (createHttpClient, TwoFactorAuthImpl) to use setHeaders() instead of manual header/user-agent setup.
  • Updates copyright year ranges.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
TwoFactorAuth/Back/src/main/kotlin/TwoFactorAuthImpl.kt Switches Ktor default request header setup to the new HttpUtils.setHeaders() helper.
Network/src/main/kotlin/com/infomaniak/core/network/networking/HttpUtils.kt Introduces Ktor HeadersBuilder.setHeaders() and refactors header generation to a shared map.
Network/Ktor/src/main/kotlin/CreateHttpClient.kt Replaces explicit Ktor accept/contentType + manual headers with setHeaders() in defaultRequest.

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

Comment thread Network/Ktor/src/main/kotlin/CreateHttpClient.kt
Comment thread Network/src/main/kotlin/com/infomaniak/core/network/networking/HttpUtils.kt Outdated
@tevincent tevincent requested a review from sirambd May 18, 2026 09:37
@sonarqubecloud
Copy link
Copy Markdown

@benjaminVadon benjaminVadon enabled auto-merge May 18, 2026 12:54
@benjaminVadon benjaminVadon merged commit c1ebc14 into main May 18, 2026
7 checks passed
@benjaminVadon benjaminVadon deleted the fix-ktor-headers branch May 18, 2026 12:55
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.

4 participants