https://github.com/efforg/rails_response_headers
Configure ActionController response headers with YAML.
https://github.com/efforg/rails_response_headers
Last synced: 4 months ago
JSON representation
Configure ActionController response headers with YAML.
- Host: GitHub
- URL: https://github.com/efforg/rails_response_headers
- Owner: EFForg
- License: mit
- Created: 2018-03-07T19:13:38.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-11-01T22:17:18.000Z (over 1 year ago)
- Last Synced: 2025-10-20T17:22:05.806Z (8 months ago)
- Language: Ruby
- Size: 6.84 KB
- Stars: 2
- Watchers: 10
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# RailsResponseHeaders
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'rails_response_headers'
```
And then execute:
$ bundle
## Usage
Create a YAML file at `config/response-headers.yml` with a mapping from your controller actions
to the set of headers which should be set in the response. For example:
```
# config/response-headers.yml
welcome#index:
Surrogate-Control: public, max-age=120
Vary: Accept-Encoding, Accept-Language
```
When the `index` action of `WelcomeController` is hit, `Surrogate-Control` and `Vary` headers will
be included in the response.
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/efforg/rails_response_headers.
## License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).