iv-org / invidious

Invidious is an alternative front-end to YouTube
https://invidious.io
GNU Affero General Public License v3.0
16.46k stars 1.85k forks source link

[Bug] Invalid URLs (e.g deprecated API routes) return HTTP 200, not error code #5088

Open dbr opened 3 days ago

dbr commented 3 days ago

Describe the bug I had some confusing when migrating to a locally hosted Invidious instance - I had some scripts which used the old deprecated API routes, which were removed in #5045

When requesting https://example.com/api/v1/channels/videos/[...channel id..] to my new instance: I get a 200 OK response code, but a completely blank page, which was very confusing.

This seems to be the case with ever URL under /api/v1/... (except those under /api/v1/auth/... which return 403 at least without an auth token, haven't checked with one)

$ curl --head https://example.com/api/v1/thisisalmostdefinitelynotavalidurl
HTTP/2 200 
access-control-allow-origin: *
alt-svc: h3=":443"; ma=2592000
content-type: text/html
server: Caddy
x-frame-options: sameorigin
content-length: 0
date: Thu, 21 Nov 2024 22:59:02 GMT

Not a major thing, but if these would return an HTTP error code, it would made debugging a bit easier

Thanks!

Steps to Reproduce Update to invidious v2.20241110.0

Logs N/a

Screenshots N/a

Additional context N/a