Pewarta Proxy

📋 Server Request & Proxy Logs

Loading active proxy settings...
Developed by Khairul Adha (adhexa.id)
Mengambil log server...

⚙️ Pengaturan Proxy Target

Skip to content

Allow strictNullHandling to work when using a custom filter - #279

Merged
ljharb merged 1 commit into
ljharb:masterfrom
Neaox:filter-strictNullHandling-fix
Nov 23, 2018
Merged

ljharb merged 1 commit into
ljharb:masterfrom
Neaox:filter-strictNullHandling-fix

Conversation

@Neaox

@Neaox Neaox commented Sep 16, 2018

Copy link
Copy Markdown
Contributor

Fixes #278

@ljharb ljharb left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please provide a test case, so it's clear what you expected to work, and how it failed?

@Neaox

Neaox commented Sep 17, 2018

Copy link
Copy Markdown
Contributor Author

Added a test as requested.

An explanation of the issue:

If you specify a custom filter in your stringify options the if case here (https://github.com/ljharb/qs/pull/279/files/ab07ce71f33704ecfac7298b055be8f481edf277#diff-dd5072864997b356b1727023f837c921L48) is run. Due the statement on line 52 (https://github.com/ljharb/qs/pull/279/files/ab07ce71f33704ecfac7298b055be8f481edf277#diff-dd5072864997b356b1727023f837c921L52) being an else if, instead of an if the null handling is not run, which then causes an error when attemping to get the keys of a null object.

By changing this else if to an if the issue is fixed.

@ljharb ljharb left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks; I also added a test case for a serializeDate that returns null, which your fix also addresses.

@ljharb
ljharb merged commit 98126ef into ljharb:master Nov 23, 2018
ljharb pushed a commit that referenced this pull request Jan 11, 2022
ljharb pushed a commit that referenced this pull request Jan 11, 2022
ljharb pushed a commit that referenced this pull request Jan 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants