-
-
Notifications
You must be signed in to change notification settings - Fork 597
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #1075 Add the ability to download raw file, needed when size …
…> 1MB (genintho) This PR was squashed before being merged into the 3.4.x-dev branch. Discussion ---------- API DOC https://docs.github.com/en/rest/repos/contents The API call to return the content of a file return an empty content if a file is bigger than 1MB. To be able to download that file, we need to provide the header `application/vnd.github.VERSION.raw`. When doing so, the API return a the raw file, instead of a JSON object with some attributes + the file content. Because the API has a different behavior, I preferred to create a dedicated method as opposed to provide accept more option in the download method and having a bunch of if/else. Note: a 3rd behavior exists for that API call when downloading markdown and passing the `application/vnd.github.VERSION.html` header, which is not supported by this code change. Commits ------- 520ffb9 Add the ability to download raw file, needed when size > 1MB ff458a2 Restore modification committed by mistake e7c393f Style fix
- Loading branch information
Showing
2 changed files
with
45 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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