From a166c4f93d7835b2f0236e8ca369d8b5cdf2f794 Mon Sep 17 00:00:00 2001 From: CncAnon Date: Mon, 4 Sep 2023 06:46:14 +0300 Subject: [PATCH] Add some required headers, fixes #4 --- main.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index cb95193..b020fd6 100644 --- a/main.js +++ b/main.js @@ -53,7 +53,10 @@ app.post('/v1/complete', async (req, res) => { baseURL: 'https://sourcegraph.com/.api/completions/stream', headers: { 'Content-Type': 'application/json', - 'Authorization': `token ${API_TOKEN}` + 'Authorization': `token ${API_TOKEN}`, + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36', + 'X-Requested-With': 'Sourcegraph', + 'X-Sourcegraph-Client': 'https://sourcegraph.com', }, responseType: 'stream', timeout: 180000,