mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
fix: return 404 for invalid shared link pages (#19493)
This commit is contained in:
parent
2e13543d5d
commit
88b8afb8d6
2 changed files with 22 additions and 24 deletions
|
|
@ -119,6 +119,16 @@ describe('/shared-links', () => {
|
|||
expect(resp.header['content-type']).toContain('text/html');
|
||||
expect(resp.text).toContain(`<meta property="og:image" content="https://my.immich.app`);
|
||||
});
|
||||
|
||||
it('should return 404 for an invalid shared link', async () => {
|
||||
const resp = await request(shareUrl).get(`/invalid-key`);
|
||||
expect(resp.status).toBe(404);
|
||||
expect(resp.header['content-type']).toContain('text/html');
|
||||
expect(resp.text).not.toContain(`og:type`);
|
||||
expect(resp.text).not.toContain(`og:title`);
|
||||
expect(resp.text).not.toContain(`og:description`);
|
||||
expect(resp.text).not.toContain(`og:image`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('GET /shared-links', () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue