Add some required headers, fixes #4

This commit is contained in:
CncAnon 2023-09-04 06:46:14 +03:00
parent e66b529d70
commit a166c4f93d
1 changed files with 4 additions and 1 deletions

View File

@ -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,