mirror of
https://github.com/fmhy/edit.git
synced 2026-01-28 06:41:16 +11:00
fix(api): add User-Agent for requests
This commit is contained in:
parent
ff3688e3aa
commit
cef2fb1efd
1 changed files with 6 additions and 1 deletions
|
|
@ -23,9 +23,14 @@ interface File {
|
||||||
|
|
||||||
export default defineEventHandler(async () => {
|
export default defineEventHandler(async () => {
|
||||||
let body = ''
|
let body = ''
|
||||||
|
const f = fetcher({
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'taskylizard'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// event.waitUntil(async () => {
|
// event.waitUntil(async () => {
|
||||||
const f = fetcher()
|
|
||||||
|
|
||||||
// Fetch the list of files in the repository
|
// Fetch the list of files in the repository
|
||||||
const files = await f.get<File[]>(GITHUB_REPO)
|
const files = await f.get<File[]>(GITHUB_REPO)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue