Skip to content
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

Validate field titles against Object.keys list #186

Merged
merged 3 commits into from May 20, 2021
Merged

Validate field titles against Object.keys list #186

merged 3 commits into from May 20, 2021

Conversation

mrodrig
Copy link
Owner

@mrodrig mrodrig commented May 19, 2021

As reported in #185, there was a bug where header values could not have
the same name as a Map method. This is because the code was naively
checking for the existence of a possible title field by simply accessing
the raw value of the Map. This resulted in Map.prototype.set being
returned when the "set" JSON key name was used. The logic has been
updated to check for header titles against an Object.keys list now since
that will not include prototype methods for the underlying Map object.

Fixes #185

Background Information

As reported in #185, there was a bug where header values could not have
the same name as a Map method. This is because the code was naively
checking for the existence of a possible title field by simply accessing
the raw value of the Map. This resulted in Map.prototype.set being
returned when the "set" JSON key name was used. The logic has been
updated to check for header titles against an Object.keys list now since
that will not include prototype methods for the underlying Map object.

Fixes #185
@coveralls
Copy link

coveralls commented May 19, 2021

Coverage Status

Coverage decreased (-1.7%) to 98.266% when pulling 9e3996a on fix-185 into 72688ef on stable.

@mrodrig mrodrig merged commit e72fa24 into stable May 20, 2021
@mrodrig mrodrig deleted the fix-185 branch May 20, 2021 04:06
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.

Fails if attribute is named 'set'
2 participants