Skip to content

Conversation

@sisp
Copy link
Contributor

@sisp sisp commented Jan 16, 2024

I've fixed the Batch API request header to include Accept: application/vnd.git-lfs+json as stated in the spec:

All Batch API requests use the POST verb, and require the following HTTP headers. The request and response bodies are JSON.

Accept: application/vnd.git-lfs+json
Content-Type: application/vnd.git-lfs+json

For instance, omitting this header leads to an error when fetching LFS objects from github.com:

$ dvc import https://github.com/githubschool/lfs-example TogglDesktop-7_4_373.dmg
Importing 'TogglDesktop-7_4_373.dmg (https://github.com/githubschool/lfs-example)' -> 'TogglDesktop-7_4_373.dmg'
...
Could not open LFS object, falling back to raw pointer
...

github.com responds to the Batch API request with HTTP status code 406 and the following response body:

{"message":"Not Acceptable","documentation_url":"https://support.github.com/contact"}

When the Accept header is included, it works fine.

@pmrowla pmrowla self-requested a review January 16, 2024 08:34
@pmrowla pmrowla self-assigned this Jan 16, 2024
@pmrowla pmrowla merged commit feecd19 into treeverse:main Jan 23, 2024
@sisp sisp deleted the fix/lfs-accept-header branch January 23, 2024 08:02
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 this pull request may close these issues.

2 participants