mirror of
https://github.com/danbulant/Mangades
synced 2026-06-19 06:11:38 +00:00
add user agent to requests
This commit is contained in:
parent
4dcdaa3783
commit
f5d7d2108b
1 changed files with 3 additions and 0 deletions
|
|
@ -11,6 +11,9 @@ export function getURL(endpoint, query) {
|
|||
function request(endpoint, query, type = "GET", body) {
|
||||
return fetch(getURL(endpoint, query), {
|
||||
method: type,
|
||||
headers: typeof window === "undefined" ? {
|
||||
"User-agent": "manga.danbulant.eu (discord @techmandancz)"
|
||||
} : undefined,
|
||||
body: body ? JSON.stringify(body) : undefined
|
||||
}).then(resp => resp.json());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue