-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Fix content download and /verify LFS handler expecting wrong content-type #7015
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Fixes go-gitea#6960 According to [spec][1], /verify requests must have `Accept: application/vnd.git-lfs+json` Previous code works because `git-lfs` also [violates spec and doesn't send any Accept header at all][2] For other clients that DO set `Accept: application/vnd.git-lfs+json`, addition of `Accept: application/vnd.git-lfs` either forces them to violate the spec or is ignored, depending on order in what they create header list. [1]: https://github.com/git-lfs/git-lfs/blob/master/docs/api/basic-transfers.md#verification [2]: git-lfs/git-lfs#3662
Codecov Report
@@ Coverage Diff @@
## master #7015 +/- ##
=========================================
Coverage ? 41.49%
=========================================
Files ? 441
Lines ? 59504
Branches ? 0
=========================================
Hits ? 24689
Misses ? 31590
Partials ? 3225
Continue to review full report at Codecov.
|
OK @slonopotamus I've closed my PR in preference to yours - the only difference I can see is that you're demanding that the lfs-client has to send to /verify with the correct content-type. (BTW We do use different urls for verify and download. What don't use is different urls for download content vs. meta that is determined by content-type.) |
Btw, git-lfs agreed that it is a bug on their side that they don't set Accept header for verify url and are going to fix it: git-lfs/git-lfs#3663 |
Fixes go-gitea#6960 According to [spec][1], /verify requests must have `Accept: application/vnd.git-lfs+json` Previous code works because `git-lfs` also [violates spec and doesn't send any Accept header at all][2] For other clients that DO set `Accept: application/vnd.git-lfs+json`, addition of `Accept: application/vnd.git-lfs` either forces them to violate the spec or is ignored, depending on order in what they create header list. [1]: https://github.com/git-lfs/git-lfs/blob/master/docs/api/basic-transfers.md#verification [2]: git-lfs/git-lfs#3662
Fixes #6960
According to spec, /verify requests must have
Accept: application/vnd.git-lfs+json
Previous code works because
git-lfs
also violates spec and doesn't send any Accept header at allFor other clients that DO set
Accept: application/vnd.git-lfs+json
, addition ofAccept: application/vnd.git-lfs
either forces them to violate the spec or is ignored, depending on order in what they create header list.