🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

rack-content_disposition_helper

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rack-content_disposition_helper

bundlerRubygems
Version
0.2.0
Version published
Maintainers
1
Created
Source

GitHub Actions Maintainability Gem Version GitHub

Rack::ContentDispositionHelper

Rack::ContentDispositionHelper is Rack middleware that rewrites the decoded filename* directive in the Content-Disposition response header as the value of the filename directive.

Safari does not use filename* if the size of the Content-Disposition response header exceeds 254Bytes, but this middleware is helpful in such cases.

This middleware checks that the User-Agent value in the request header is Safari-like. If the User-Agent is not Safari-like, no processing is performed.

Usage example

Rails app

Add this line to your application's Gemfile:

# Gemfile
gem 'rack-content_disposition_helper'

And then execute:

$ bundle

This will load rack-content_disposition_helper and set it up as a Rails middleware. The middleware is inserted for all of environment.

You don't need to add middleware to rails middleware stack.

Sinatra and other Rack apps

Add this line to your application's Gemfile:

# Gemfile
gem 'rack-content_disposition_helper'

And then execute:

$ bundle

For Sinatra and other Rack apps, add this to config.ru:

# config.ru

# Bundler.require or require 'rack/content_disposition_helper'
use Rack::ContentDispositionHelper

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/hana-da/rack-content_disposition_helper. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Rack::ContentDispositionHelper project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

FAQs

Package last updated on 04 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts