fix(core): accept header not working (#14961)

This commit is contained in:
Tony 2024-03-26 03:02:47 +08:00 committed by GitHub
parent 607a9455e2
commit 6e53d7263c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View File

@ -40,15 +40,16 @@ async function handler(ctx) {
},
});
const data = response.map((repo) => ({
const data = response.map(({ starred_at, repo }) => ({
title: `${user} starred ${repo.name}`,
author: user,
description: `${repo.description ?? 'No Description'}<br>
Primary Language: ${repo.language ?? 'Primary Language'}<br>
Stargazers: ${repo.stargazers_count}<br>
<img sytle="width:50px;" src="https://opengraph.githubassets.com/${md5(repo.updated_at)}/${repo.full_name}">`,
pubDate: parseDate(repo.starred_at),
pubDate: parseDate(starred_at),
link: repo.html_url,
category: repo.topics,
}));
return {

View File

@ -60,7 +60,7 @@ const requestWrapper = (url: string, options: http.RequestOptions = {}) => {
}
// Accept
if (!headersLowerCaseKeys.has('Accept')) {
if (!headersLowerCaseKeys.has('accept')) {
options.headers.Accept = '*/*';
}