No commit activity in last 3 years
No release in over 3 years
Rack Middleware for JSON APIs accessed cross-domain from legacy browsers Firefox version 4 does not support response headers for cross-domain requests. This middleware intercepts all requests and if the X-WRAP-RESPONSE is set, the response will be wrappped in JSON like {header: ..., body: ...}
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

= 0.6.2
= 3.0.0
= 1.4.5
 Project Readme

rack-json_response_wrapper

Rack Middleware for JSON APIs accessed cross-domain from legacy browsers

Firefox versions <4 does not support response headers for cross-domain requests. This middleware intercepts all requests and if the X-WRAP-RESPONSE is set, the response will be wrappped in JSON as follows:

Suppose the following is the original response body:

{"key": "value"}

With X-WRAP-RESPONSE set to true, the new response will be:

{
  "header": { ... bunch of headers ... },
  "body": {"key": "value"}
}