Skip to content

Instantly share code, notes, and snippets.

View danielwestendorf's full-sized avatar
:shipit:
shipping

Daniel Westendorf danielwestendorf

:shipit:
shipping
View GitHub Profile
@danielwestendorf
danielwestendorf / compress_requests.rb
Created March 28, 2017 23:28 — forked from relistan/compress_requests.rb
Rack Middleware to automatically unzip gzipped/deflated POST data
class CompressedRequests
def initialize(app)
@app = app
end
def method_handled?(env)
!!(env['REQUEST_METHOD'] =~ /(POST|PUT)/)
end
def encoding_handled?(env)