From d883dbb3370545efe208c77593b0fc54c811410c Mon Sep 17 00:00:00 2001 From: Ueli Kunz Date: Fri, 4 Oct 2024 18:13:47 +0200 Subject: [PATCH] fix authorization header --- server/app.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/app.ts b/server/app.ts index 54edbaf..c75778f 100644 --- a/server/app.ts +++ b/server/app.ts @@ -22,7 +22,7 @@ const editor_password = getConfig('editor_password') const app = new Application() const router = new Router() const ghApiOpts = { - headers: new Headers({'Authorization': gh_gist_token, "X-GitHub-Api-Version": "2022-11-28", 'accept': 'application/json'}) + headers: new Headers({'Authorization': 'Bearer ' + gh_gist_token, "X-GitHub-Api-Version": "2022-11-28", 'accept': 'application/json'}) } const octokit = (path: string, method = 'GET', body: object | null = null) => fetch('https://api.github.com'+path, { method, ...ghApiOpts, body: body ? JSON.stringify(body) : null}) const rawOctokit = (path: string) => fetch('https://gist.githubusercontent.com'+path, ghApiOpts)