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

route.payload.allow as Array never matches #1401

Closed
seanmonstar opened this issue Feb 7, 2014 · 0 comments
Closed

route.payload.allow as Array never matches #1401

seanmonstar opened this issue Feb 7, 2014 · 0 comments
Assignees
Labels
bug Bug or defect
Milestone

Comments

@seanmonstar
Copy link

payload: {
  allow: ['application/json', 'image/jpeg']
}

This will never match json nor jpeg. The if check in payload.js wrongly evaluates to true, since payload.allow !== mime, as it is an array.

https://github.com/spumko/hapi/blob/master/lib/payload.js#L66-L68

Noticed there also wasn't a test in unit or integration for when payload.allow is an array.

@hueniverse hueniverse added the bug label Feb 8, 2014
@hueniverse hueniverse added this to the 2.1.3 milestone Feb 8, 2014
@hueniverse hueniverse self-assigned this Feb 8, 2014
@lock lock bot locked as resolved and limited conversation to collaborators Jan 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bug or defect
Projects
None yet
Development

No branches or pull requests

2 participants