Skip to content

Fix: Add validation for invalid query parameter values #3326

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 0 commits into from

Conversation

18rameez
Copy link

@18rameez 18rameez commented Oct 5, 2024

PR for Issue #3318

Issue Description:

Currently, new Date(undefined) (an invalid date) is serialized as "0NaN-NaN-NaNTNaN:NaN:NaN.NaN+NaN:NaN". It should fail early with a JS error instead of being passed to the database.

@ikonst
Copy link

ikonst commented Oct 5, 2024

There must already be places where Date objects are converted to pg-compatible strings. It's probably more prudent to add a check there than to scan the parameters separately.

@ikonst
Copy link

ikonst commented Oct 5, 2024

Also, consider adding tests.

@18rameez 18rameez closed this Oct 6, 2024
@18rameez 18rameez force-pushed the fix/query-param-validation branch from c0384f3 to 92cb640 Compare October 6, 2024 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants