Pass go headers through in updater/differential

This commit is contained in:
Fedor Indutny 2022-03-02 10:06:58 -08:00 committed by GitHub
parent 637b67d9a5
commit da7a76e03f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -76,6 +76,12 @@ describe('updater/differential', () => {
beforeEach(callback => {
server = http.createServer(async (req, res) => {
if (!req.headers['user-agent']?.includes('Signal-Desktop')) {
res.writeHead(403);
res.end(`Invalid user agent: "${req.headers['user-agent']}"`);
return;
}
const file = req.url?.slice(1) ?? '';
if (!allowedFiles.has(file)) {
res.writeHead(404);