Commit 0158c30
authored
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 fix1 parent a43662d commit 0158c30
File tree
2 files changed
+45
-6
lines changed- lib/Github/Api/Repository
- test/Github/Tests/Api/Repository
2 files changed
+45
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
71 | | - | |
| 72 | + | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| |||
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
80 | | - | |
| 81 | + | |
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
| |||
294 | 295 | | |
295 | 296 | | |
296 | 297 | | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
297 | 319 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
319 | 319 | | |
320 | 320 | | |
321 | 321 | | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
322 | 339 | | |
323 | 340 | | |
324 | 341 | | |
| |||
0 commit comments