【发布时间】:2018-05-30 16:45:04
【问题描述】:
当我尝试使用Github.js 从大于~1MB 的文件中获取Sha(以及随后的getBlob)时,我收到了403 错误。文件大小有限制吗?代码如下:
var gh = new GitHub({
username: username,
password: password
});
// get the repo from github
var repo = gh.getRepo('some-username','name-of-repo');
// get promise
repo.getSha('some-branch', 'some-file.json').then(function(result){
// pass the sha onto getBlob
return repo.getBlob(result.data.sha);
}).then(function(result){
do_something_with_blob(result.data);
});
GitHub API 表示它支持最大 100MB 大小的 blob,我在 Github.js docs 中找不到任何关于文件大小限制的信息。此外,这些文件来自私人 Github 存储库。
【问题讨论】:
标签: javascript github github-api http-status-code-403 github.js