stephencelis/crepe — pull request #28 by stephencelis (2013-05-22 04:24:37+00:00)
Title: Create generic JavaScript callback filter

This is a drop-in replacement for JSONP. It allows any response to be
returned as a JavaScript callback. The first argument is the body (the
original JSON object for JSON responses, a to-JSON'd object otherwise),
while the second and third arguments are the headers and status code
respectively.

The headers are all lower-camelized (to facilitate JavaScript in the
form of `headers.contentType` over `headers['Content-Type']` (this
format isn't frozen yet, we may favor the latter, later); the status
code is an integer.

With this filter, HTML, plaintext, and other media types can be passed
to a JavaScript API.

Acked-by: Evan Owen
Signed-off-by: Stephen Celis