From 2336b296427d1a2bc5eb1bceef663123e0777411 Mon Sep 17 00:00:00 2001 From: Danny Spina Date: Mon, 19 Jun 2023 12:40:07 +0200 Subject: [PATCH] Try to add user agent --- index.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/index.ts b/index.ts index f7728b5..a690039 100644 --- a/index.ts +++ b/index.ts @@ -22,7 +22,13 @@ app.get("/", (req, res) => { return } - got(`${searchEngine}?q=${query}`) + const options = { + headers: { + 'user-agent': req.headers["user-agent"] + } + } + + got(`${searchEngine}?q=${query}`, options) .then((response) => { if (response.statusCode !== 200) {