Skip to content

Fix for raw() parser if body is empty - #188

Closed
Olivier-OH wants to merge 5 commits into
expressjs:masterfrom
Olivier-OH:master
Closed

Fix for raw() parser if body is empty#188
Olivier-OH wants to merge 5 commits into
expressjs:masterfrom
Olivier-OH:master

Conversation

@Olivier-OH

Copy link
Copy Markdown

Set it to empty string rather than an empty Object.

See issue #187

raw() parser: if body is empty set it to empty string rather than empty dictionnary.
@Olivier-OH

Olivier-OH commented Jul 27, 2016

Copy link
Copy Markdown
Author

Unit tests don't pass because somewhere an empty object is expected instead of an empty string.

I don't know whether I should change the unit test code. Is this important that the body is an empty object instead of an empty string?

@Olivier-OH

Copy link
Copy Markdown
Author

I changed the unit test code. I'll let the repo owners decide whether this is correct.

@dougwilsondougwilson self-assigned this Jul 30, 2016
@dougwilson

Copy link
Copy Markdown
Contributor

Hi @Olivier-OH, defaulting to a string in the raw parser does not make sense, since a successful raw parse results in a Buffer object, not a string. Besides, we actually went ahead and fixed these semantics in the 2.0 branch. Please go ahead and check out the proposed 2.0 release in #66 :)

@Olivier-OH

Copy link
Copy Markdown
Author

Great! Thanks for your feedback.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@Olivier-OH@dougwilson