Skip to content

Fix: Add validation for invalid query parameter values - #3326

Closed
abbas-ramish wants to merge 0 commit into
brianc:masterfrom
abbas-ramish:fix/query-param-validation
Closed

Fix: Add validation for invalid query parameter values#3326
abbas-ramish wants to merge 0 commit into
brianc:masterfrom
abbas-ramish:fix/query-param-validation

Conversation

@abbas-ramish

Copy link
Copy Markdown

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

ikonst commented Oct 5, 2024

Copy link
Copy Markdown

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

ikonst commented Oct 5, 2024

Copy link
Copy Markdown

Also, consider adding tests.

@abbas-ramish
abbas-ramish 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