Fix link previews for YouTube Music

This commit is contained in:
Evan Hahn 2021-01-11 15:43:44 -06:00 committed by GitHub
parent 0a35489696
commit 172598b354
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 8 deletions

View file

@ -1,4 +1,4 @@
// Copyright 2020 Signal Messenger, LLC
// Copyright 2020-2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { assert } from 'chai';
@ -143,7 +143,7 @@ describe('link preview fetching', () => {
sinon.assert.notCalled(warn);
});
it('sends "WhatsApp" as the User-Agent for compatibility', async () => {
it('sends WhatsApp as the User-Agent for compatibility', async () => {
const fakeFetch = stub().resolves(makeResponse());
await fetchLinkPreviewMetadata(
@ -157,7 +157,7 @@ describe('link preview fetching', () => {
'https://example.com',
sinon.match({
headers: {
'User-Agent': 'WhatsApp',
'User-Agent': 'WhatsApp/2',
},
})
);
@ -1273,7 +1273,7 @@ describe('link preview fetching', () => {
);
});
it('sends "WhatsApp" as the User-Agent for compatibility', async () => {
it('sends WhatsApp as the User-Agent for compatibility', async () => {
const fakeFetch = stub().resolves(new Response(null));
await fetchLinkPreviewImage(
@ -1287,7 +1287,7 @@ describe('link preview fetching', () => {
'https://example.com/img',
sinon.match({
headers: {
'User-Agent': 'WhatsApp',
'User-Agent': 'WhatsApp/2',
},
})
);