Skip to content

Conversation

@drevell
Copy link

@drevell drevell commented Oct 9, 2025

Maybesfixes #11891 ?

The http.Client used during OAuth authentication was not configured to use the 'http_unix_socket' value from the user's config. This caused authentication to fail for users who rely on a Unix socket for HTTP traffic.

This commit fixes the issue by creating a shared api.NewPlainHTTPClient that correctly configures the transport to use the Unix socket if one is specified. This new function is now used in both the auth flow and auth refresh commands, ensuring consistent behavior.

Additionally, this resolves an issue where the wrong Accept header was being sent during the OAuth device flow, which resulted in an HTTP 406 error.

This should be reviewed skeptically because:

  • The author has no experience with the internals of the git CLI
  • Some users may have come to rely on the broken behavior and might be surprised that the device auth flow suddenly starts working and showing a device code instead of running the browser flow.

The http.Client used during OAuth authentication was not configured to
use the 'http_unix_socket' value from the user's config. This caused
authentication to fail for users who rely on a Unix socket for HTTP
traffic.

This commit fixes the issue by creating a shared api.NewPlainHTTPClient
that correctly configures the transport to use the Unix socket if one is
specified. This new function is now used in both the auth flow and
auth refresh commands, ensuring consistent behavior.

Additionally, this resolves an issue where the wrong Accept header was
being sent during the OAuth device flow, which resulted in an HTTP 406
error.
@drevell drevell requested a review from a team as a code owner October 9, 2025 19:07
@drevell drevell requested a review from babakks October 9, 2025 19:07
@cliAutomation cliAutomation added the external pull request originating outside of the CLI core team label Oct 9, 2025
@cliAutomation
Copy link
Collaborator

Hi! Thanks for the pull request. Please ensure that this change is linked to an issue by mentioning an issue number in the description of the pull request. If this pull request would close the issue, please put the word 'Fixes' before the issue number somewhere in the pull request body. If this is a tiny change like fixing a typo, feel free to ignore this message.

@babakks
Copy link
Member

babakks commented Oct 10, 2025

Thanks for the PR, but I'm closing this as I've already explained in #11891 (comment).

@babakks babakks closed this Oct 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external pull request originating outside of the CLI core team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants