Skip to content

fix: stop using okhttp3.internal StatusLine constants - #2209

Merged
Vincent Biret (baywet) merged 1 commit into
microsoft:mainfrom
hardikkaurani:fix/remove-okhttp-internal
Oct 19, 2026
Merged

Vincent Biret (baywet) merged 1 commit into
microsoft:mainfrom
hardikkaurani:fix/remove-okhttp-internal

Conversation

@hardikkaurani

Copy link
Copy Markdown
Contributor

Fixes #2127

RedirectHandler.java was referencing internal constants HTTP_PERM_REDIRECT (308) and HTTP_TEMP_REDIRECT (307) from okhttp3.internal.http.StatusLine.

These classes are internal implementation details of OkHttp, are removed in OkHttp 5, and are slated to be restricted in modularized JVM environments.

Changes

  • Remove imports from okhttp3.internal.http.StatusLine
  • Define HTTP_TEMP_REDIRECT = 307 and HTTP_PERM_REDIRECT = 308 as private constants in RedirectHandler

@hardikkaurani
Hardik K (hardikkaurani) requested a review from a team as a code owner October 19, 2026 15:39
Copilot AI balanced review requested due to automatic review settings October 19, 2026 15:39
@hardikkaurani

Copy link
Copy Markdown
Contributor Author

Hi Vincent Biret (@baywet)! 👋

This PR resolves #2127 by replacing references to okhttp3.internal.http.StatusLine with local status code constants (307 and 308). This removes the reliance on OkHttp internal APIs ahead of OkHttp 5 and modularity restrictions.

Please take a look when you have a moment! Thank you!

This comment was marked as outdated.

@baywet Vincent Biret (baywet) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the contribution!

@github-project-automation github-project-automation Bot moved this to In Progress 🚧 in Kiota Oct 19, 2026
@hardikkaurani

Copy link
Copy Markdown
Contributor Author

Welcome Vincent Biret (@baywet)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The narrow replacement preserves existing values and behavior, with no unresolved findings.

No open issues 🎉

Review effort: Balanced

@baywet
Vincent Biret (baywet) merged commit 6df4401 into microsoft:main Oct 19, 2026
9 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress 🚧 to Done ✔️ in Kiota Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done ✔️

Development

Successfully merging this pull request may close these issues.

Stop using okhttp3.internal

3 participants