mirror of
https://github.com/danbulant/Mangades
synced 2026-07-05 11:00:40 +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) {
|
function request(endpoint, query, type = "GET", body) {
|
||||||
return fetch(getURL(endpoint, query), {
|
return fetch(getURL(endpoint, query), {
|
||||||
method: type,
|
method: type,
|
||||||
|
headers: typeof window === "undefined" ? {
|
||||||
|
"User-agent": "manga.danbulant.eu (discord @techmandancz)"
|
||||||
|
} : undefined,
|
||||||
body: body ? JSON.stringify(body) : undefined
|
body: body ? JSON.stringify(body) : undefined
|
||||||
}).then(resp => resp.json());
|
}).then(resp => resp.json());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue