Skip to content

media.HandleUpload panics when reading the upload fails #147

Description

@can3p

media.HandleUpload (pkg/media/upload.go) calls panic(err) when io.ReadAll on the upload reader fails, instead of returning the error. A client that drops the connection mid-upload turns into a recovered panic (and an admin panic notification) rather than an ordinary error response.

Repro: call HandleUpload with a valid user ID and an io.Reader whose Read returns an error.

Expected: HandleUpload returns the (wrapped) read error.

Pinned by a skipped test, TestHandleUpload_ReaderError, in pkg/media/upload_test.go.

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