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

Request.multipart no longer crashes when header 'Content-type' present #715

Merged
merged 1 commit into from
Nov 26, 2013

Conversation

pastaclub
Copy link
Contributor

Request.multipart used to crash when options contained a header 'Content-type' which is not purely lowercase. That is because hasHeader is case-insensitive and returns true, then the split method gets applied to undefined and crashes the application.

One could argue that headers should be spelled using only lowercase. However, mixed case headers used to work with a previous version of request, thus I suggest to incorporate this patch to ensure that legacy code does not suddenly crash after updating request.

…sent

Request.multipart used to crash when options contained a header 'Content-type' which is not purely lowercase. That is because hasHeader is case insensitive and returns true and then the split method gets applied to undefined and crashes the application. One could argue that headers should be spelled using only lowercase. However, mixed case headers used to work with a previous version of request, thus I suggest to incorporate this patch to ensure that legacy code does not suddenly crash after updating request.
mikeal added a commit that referenced this pull request Nov 26, 2013
Request.multipart no longer crashes when header 'Content-type' present
@mikeal mikeal merged commit 50b2873 into request:master Nov 26, 2013
nylen pushed a commit to nylen/request that referenced this pull request Oct 17, 2014
Request.multipart no longer crashes when header 'Content-type' present
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