+
Skip to content

Writing a new file fails on 404 GET after a 204 OPTIONS returns no content #183

Closed
@TomasHubelbauer

Description

@TomasHubelbauer

I'm using this code snippet:

// The gh instance is Github object property on window authorized with a personal access token.
var repo = gh.getRepo("TomasHubelbauer", "TomasHubelbauer.Github.io")
repo.write("master", "Test.md", "# Test", "Create Test.md programatically", function (err)
{
  console.log(err);
});

When examining the Network tab, first I see 204 OPTIONS with no content returned and then 404 GET, both to:
https://api.github.com/repos/TomasHubelbauer/TomasHubelbauer.Github.io/contents/Test.md?…

The file doesn't exist and I'm trying to create it for the first time.

Is it possible that my personal access token is too restrictive and doesn't offer write access or something? Currently it has only the public_repo scope, which I thought should be enough.

I also get Uncaught TypeError: btoa is not a function on github.js:667.

Will investigate further, just putting this out there in case someone experienced this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载