mirror of
https://github.com/Elysola/WebHooker.git
synced 2026-11-21 01:23:40 +00:00
fix(github): send User-Agent header on GitHub API requests
GitHub rejects API requests without a User-Agent (403), and Workers' fetch does not set one by default, so workflow job enrichment and check-suite build-log lookups silently failed in production.
This commit is contained in:
4 files changed
+29
-2
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { getInstallationToken, GITHUB_API_VERSION } from "./app-token";
|
||||
import { getInstallationToken, GITHUB_API_VERSION, GITHUB_USER_AGENT } from "./app-token";
|
||||
|
||||
const CLOUDFLARE_SLUG = "cloudflare-workers-and-pages";
|
||||
|
||||
@@ -28,6 +28,7 @@ export async function getCheckSuiteBuildLogUrl(
|
||||
Authorization: `Bearer ${token}`,
|
||||
Accept: "application/vnd.github+json",
|
||||
"X-GitHub-Api-Version": GITHUB_API_VERSION,
|
||||
"User-Agent": GITHUB_USER_AGENT,
|
||||
},
|
||||
});
|
||||
if (!runsRes.ok) return undefined;
|
||||
|
||||
Reference in new issue
Block a user