Fix missing authentication in GitHubUrlReader

An oversight that probably stems from that most repositories for tech-docs are public anyway. 
Ours are not, and are inside of a GitHub Enterprise, which is how i found this tiny bug. 

I wish i knew how to mock the cross-fetch in order to inspect the Authorization header of the request to test this fix. 
I can only confirm that it works on our backstage that targets GHE.
This commit is contained in:
Mikael Östberg
2020-12-03 20:41:31 +01:00
committed by GitHub
parent 90fbdd8c36
commit 6c91854391
@@ -196,6 +196,7 @@ export class GithubUrlReader implements UrlReader {
new URL(
`${protocol}://${resource}/${full_name}/archive/${ref}.tar.gz`,
).toString(),
getApiRequestOptions(this.config)
);
if (!response.ok) {
const message = `Failed to read tree from ${url}, ${response.status} ${response.statusText}`;