Skip to content

[BUG]: octokit.repo.getReleaseAsset download binary content failing #772

@amber-beasley-liatrio

Description

@amber-beasley-liatrio

What happened?

When using as documented, observed content blocked errors instead of expected return.

The expectation is that the contents of the asset would be streamed if we use Octokit to hit this api endpoint where GitHub traditionally blocks CORS.

I am using octokit in .tsx files and attempting to get the contents of a json file from the release asset specific as a particular id.

const assetResponse = await octokit.rest.repos.getReleaseAsset({
            owner,
            repo,
            asset_id: resultsAsset.id,
              headers: {
                accept: "application/octet-stream",
            }
});

Versions

octokit/rest v21.0.2, Node v20.16.0

Relevant log output

Preflight response is not successful. Status code: 405
Fetch API cannot load ... due to access control checks.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BugSomething isn't working as documented

    Type

    No type

    Projects

    Status

    🔥 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions