From f5d7d2108b72c366daf7b826b5cf9243ca555f70 Mon Sep 17 00:00:00 2001 From: Daniel Bulant Date: Sat, 14 Oct 2023 19:21:10 +0200 Subject: [PATCH] add user agent to requests --- src/lib/util/request.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/util/request.js b/src/lib/util/request.js index ed79a7b..9317502 100644 --- a/src/lib/util/request.js +++ b/src/lib/util/request.js @@ -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()); }