{{ message }}
Repository navigation
Fix extra header duplication on retry - #6204
Merged
Merged
Conversation
Member
Member
ypfaff
force-pushed
the
fix/6202-infinite-auth-loop
branch
from
March 15, 2026 12:06
faa2070 to
c54b4a2
Compare
Contributor
Author
chrisd8088
reviewed
Mar 30, 2026
chrisd8088
left a comment
Member
There was a problem hiding this comment.
Thanks again for this PR, and for your patience while we get PR #6018 finalized!
I looked at the last commit in this PR and it looks very good! Thanks especially for writing a test. I made a couple of suggestions only, so please take a look whenever you get a chance.
Thanks again very much for your help!
Previously, `ExtraHeadersFor` blindly appended configured extra headers to the request. If a request was retried (reusing the same *http.Request object), these headers would be duplicated (e.g., "Authorization: Bearer x, Bearer x"), resulting in a malformed header and subsequent 401 errors. Relates to git-lfs#6202
ypfaff
force-pushed
the
fix/6202-infinite-auth-loop
branch
from
April 2, 2026 11:20
c54b4a2 to
e3e3a49
Compare
chrisd8088
approved these changes
Apr 5, 2026
chrisd8088
left a comment
Member
There was a problem hiding this comment.
This looks great, thank you!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes the header duplication issue reported in #6202 by adding a deduplication check in
ExtraHeadersForbefore appending headers. This prevents values likeAuthorization: Bearer x, Bearer xwhen the same*http.Requestis reused during auth retries.Rebased on top of #6018.
Fixes #6202