mac- / ratify

A Hapi plugin for validating the schema of path, query, request body, and response body params using JSON-schema
MIT License
71 stars 27 forks source link

Unhandled error if payload is expected but not provided #2

Closed dschenkelman closed 10 years ago

dschenkelman commented 10 years ago

The cause is https://github.com/mac-/ratify/blob/master/lib/RouteSchemaManager.js#L242.

Basically if (request.raw.req.headers['content-type'].indexOf('application/x-www-form-urlencoded') === 0) should handle the case where request.raw.req.headers['content-type'] is undefined.

mac- commented 10 years ago

Thanks, I'll get this fixed today.

dschenkelman commented 10 years ago

Cool, thanks :)