Skip to content

GET /user-media/<unknown name>/<class> returns 500 instead of 404 #154

Description

@can3p

The user-media/:fname/:class handler (cmd/web/main.go, around line 250) panics on any error from mediaServer.ServeImage. That includes the storage's not-found error for a name that doesn't exist, so gin's recovery middleware answers 500. In the cluster, the panic also sends a panic email.

Reproduction: GET /user-media/does-not-exist.webp/thumb returns 500.

Expected: 404 for an unknown name; only real storage failures should be a 5xx.

Pinned by the skipped test TestE4_UploadImage_UnknownName in e2e/api_test.go (W3).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions