fix: return 404 for invalid shared link pages (#19493)

This commit is contained in:
Jason Rasmussen 2025-06-24 11:37:14 -04:00 committed by GitHub
parent 2e13543d5d
commit 88b8afb8d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 22 additions and 24 deletions

View file

@ -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', () => {