immich icon indicating copy to clipboard operation
immich copied to clipboard

Bad share URL returns a 200 Page not found, not 404

Open mattheys opened this issue 1 year ago • 1 comments

The bug

When entering a random share url the http return code is still 200 and not 404.

Could Immich return the correct code when an invalid share key is used?

I want to write a new or configure an existing proxy server that will take in a public share URL and if Immich returns a 200, then set a Cookie that will allow it to then retrieve the rest of the assets to display the page. If the cookie is missing then the proxy will not return anything.

This would be a lot easier if Immich returned correct http codes for errors and not just used 200 with a custom page.

The OS that Immich Server is running on

Debian 11

Version of Immich Server

v1.120.1

Version of Immich Mobile App

na

Platform with the issue

  • [X] Server
  • [X] Web
  • [ ] Mobile

Your docker-compose.yml content

NA

Your .env content

NA

Reproduction steps

  1. Share a public Album via link
  2. Turn on web developer tools
  3. Browse to link
  4. Notice the document return is 200 not 404 ...

Relevant log output

No response

Additional information

No response

mattheys avatar Nov 08 '24 12:11 mattheys

This seems to be happening because when you load the share page, it loads a generic page and then calls the API to get information about that share, which then returns a 401.

CrushedAsian255 avatar Nov 10 '24 06:11 CrushedAsian255