Open
Description
What happened?
It seems that ever since the very beginning of this project, it has been naively converting every file to text that has charset=utf-8
in it's content type.
The final condition in getResponseData()
to return a simple ArrayBuffer
is almost never reached because of that
request.js/src/fetch-wrapper.ts
Lines 168 to 172 in f7b9616
Reproduction:
import { Octokit } from "octokit";
const octokit = new Octokit({
auth: "<token>"
});
const response = await octokit.rest.repos.getContent({
owner: "wolfy1339",
repo: "test-repository-test",
path: "training.opus",
mediaType: {
format: "raw"
}
});
console.log(request.data); // Mangled binary data
See also octokit/rest.js#14
Versions
Octokit 4.1.2
Relevant log output
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Type
Projects
Status
🆕 Triage