No commit activity in last 3 years
No release in over 3 years
Prepend AngularJS JSON vulnerability protection string ")]}',\n" to all JSON responses.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0
 Project Readme

angularjs_json_middleware: Rack middleware for AngularJS JSON vulnerability protection.

Prepend AngularJS JSON vulnerability protection string ")]}',\n" to all JSON responses. See https://docs.angularjs.org/api/ng/service/$http.


Requirements

Rack

Installation

Gemfile

Add to your Gemfile:

gem 'angularjs_json_middleware'

Or lock it to the current backwards compatible version:

gem 'angularjs_json_middleware', '~> 0.0.1'
Config

Add the middleware to the stack.

For general use add it to your config.ru.

use AngularjsJsonMiddleware

For rails add it to config/application.rb.

class Application < Rails::Application
  ...
  config.middleware.use AngularjsJsonMiddleware
  ...
end

License

The MIT License (MIT)