req.body validity in route methods in director (in POST requests) ... #86

Open
codevin opened this Issue Dec 5, 2012 · 4 comments

Comments

Projects
None yet
5 participants
@codevin

codevin commented Dec 5, 2012

req.body is currently interpreted for mimetypes such as application/x-www-form-urlencoded.
lib/director/http/index.js: Router.prototype.parse function:

 req.body = req.body && req.body.length
    ? parser(req.body)   // get it processed through mimetype parser.
    : {};

But in the process, if there is no mimetype associated, it is set to null, and the original body data is lost. Can we retain it (as string object)?

@pksunkara

This comment has been minimized.

Show comment Hide comment
@pksunkara

pksunkara Dec 6, 2012

Contributor

@indexzero should answer this.

Contributor

pksunkara commented Dec 6, 2012

@indexzero should answer this.

@mmalecki

This comment has been minimized.

Show comment Hide comment
@mmalecki

mmalecki Dec 6, 2012

Contributor

We should retain it as Buffer or string object, yes.

Contributor

mmalecki commented Dec 6, 2012

We should retain it as Buffer or string object, yes.

@indexzero

This comment has been minimized.

Show comment Hide comment
@indexzero

indexzero Dec 19, 2012

Member

+1

Member

indexzero commented Dec 19, 2012

+1

@jcrugzz

This comment has been minimized.

Show comment Hide comment
@jcrugzz

jcrugzz Jan 30, 2013

Member

This is in directors code base. Seems here that if there is no parser for the mimetype then it is just passed through.

Member

jcrugzz commented Jan 30, 2013

This is in directors code base. Seems here that if there is no parser for the mimetype then it is just passed through.

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