New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

degzipper

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

degzipper

  • 0.0.6
  • Rubygems
  • Socket score

Version published
Maintainers
2
Created
Source

Degzipper

Rack middleware to inflate incoming Gzip data from HTTP requests.

Build Status Code Climate

Getting Started

Degzipper is a Rack Middleware. That means that you can use it the same way that you use any other Rack middleware. For example, to use in a Sinatra application I might do this:

require 'sinatra'
require 'degzipper'

class MyApplication < Sinatra::Base
  use Rack::Session::Cookie
  use Degzipper::Middleware
end

For a Rails application this is handled for you automatically, just add the gem to your Gemfile.

Installation

Add this line to your application's Gemfile:

gem 'degzipper'

And then execute:

$ bundle

Or install it yourself as:

$ gem install degzipper

Try it out

After you install Degzipper to your Rails application, give it a try. Simply gzip a file like so:

gzip my_file.json

And then send the gzipped file data to your route via a PUT or POST CURL request:

curl -X PUT --header 'Content-Encoding: gzip' --data-binary @my_file.json.gz http://example.com/myroute

Where before you would have been greeted with an ArgumentError like:

ArgumentError (invalid %-encoding (o?0??+8???ʶd?H?"C??ԥ5<??Y"??H6?????N??߽???Έ???Z?.?????0$ٸߏk0??%4??Vwg*????9?#?7FF?J??D?N

Now your application will recieve the data inflated as if it was never gzipped!

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Credits

Credit to relistan for the original gist

FAQs

Package last updated on 09 Dec 2016

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc