Fixed handling of parameters with names that are keys in Object.prototype. #1

Open
wants to merge 3 commits into
from

Conversation

Projects
None yet
1 participant

In the current code, if a query string parameter has a name with a key in Object.prototype, then the query string parse logic will treat the existing value as if it had been passed first in the query string.

Example:
Expected behavior: 'toString=bar' => { toString: 'bar' }
Actual behavior: 'toString=bar' => { toString: [Object.prototype.toString, 'bar'] }

This commit changes the existing parameter check to use Object.prototype.hasOwnProperty, which prevents influence from Object.prototype's keys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment