Skip to content

Resale listing price accepts non-numeric strings, causing an uncaught 500 #12

Description

@presidojay1

price is validated only with @IsString(). It flows directly into BigInt(price) downstream. A non-numeric value (e.g. "abc") makes BigInt() throw a plain SyntaxError, which isn't an HttpException, so Nest returns a generic 500 instead of a 400 with a useful message.

Suggested fix: Add @Matches(/^[1-9]\d*$/, { message: 'price must be a positive integer string' }) to the price field.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions