Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gnidan/rack-json_response_wrapper
Rack Middleware for JSON APIs accessed cross-domain from legacy browsers
https://github.com/gnidan/rack-json_response_wrapper
Last synced: 23 days ago
JSON representation
Rack Middleware for JSON APIs accessed cross-domain from legacy browsers
- Host: GitHub
- URL: https://github.com/gnidan/rack-json_response_wrapper
- Owner: gnidan
- License: unlicense
- Created: 2014-08-27T17:03:40.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-09-15T20:57:45.000Z (about 10 years ago)
- Last Synced: 2024-10-07T18:41:30.477Z (about 1 month ago)
- Language: Ruby
- Size: 172 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this 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"}
}