Skip to content
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

lfs-test-server tricks client into violation of LFS spec #85

Closed
slonopotamus opened this issue May 16, 2019 · 6 comments · Fixed by #86
Closed

lfs-test-server tricks client into violation of LFS spec #85

slonopotamus opened this issue May 16, 2019 · 6 comments · Fixed by #86
Assignees

Comments

@slonopotamus
Copy link

slonopotamus commented May 16, 2019

https://github.com/git-lfs/lfs-test-server/blob/master/server.go#L554

Server tells client to use Accept: application/vnd.git-lfs header when accessing various links, including /verify. However, LFS specification clearly states that client sends Accept: application/vnd.git-lfs+json when accessing verification link.

Current behavior turns our to work with native git-lfs implementation, but not with other clients (git-lfs-java, for example) and overall is very fragile and depends on the order in which client builds its HTTP headers list.

@slonopotamus
Copy link
Author

Same issue in gitea (because their code is based on lfs-test-server): go-gitea/gitea#6960

@slonopotamus
Copy link
Author

Also see git-lfs/git-lfs#3662.

@slonopotamus
Copy link
Author

See go-gitea/gitea#7015 for a way to fix server while preserving compatibility with git-lfs versions that do not have git-lfs/git-lfs#3662 fixed.

@bk2204
Copy link
Member

bk2204 commented May 22, 2019

Yeah, I think this definitely should be fixed. I have a fix and am in the middle of writing some tests for this.

@bk2204 bk2204 self-assigned this May 22, 2019
@slonopotamus
Copy link
Author

Feel free to @ me when you publish your changes.

@bk2204
Copy link
Member

bk2204 commented May 22, 2019

Actually, I just realized that I can't write a test for this because that code path requires tusd, which we can't require in the testsuite.

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 a pull request may close this issue.

2 participants