Sha256: 9aea45637ef53b04de11c30310371294f595904e9481124c7e9cde678027ec5d
Contents?: true
Size: 539 Bytes
Versions: 7
Compression:
Stored size: 539 Bytes
Contents
%w{ rack/utils }.each { |m| require m } module Murlsh # Rack middleware to add the content encoding to the end of the ETag because # ETag must be different for different representations. class EtagAddEncoding def initialize(app); @app = app; end def call(env) status, headers, body = @app.call(env) headers = Rack::Utils::HeaderHash.new(headers) if headers['ETag'] headers['ETag'].sub!(/(")?$/, "#{headers['Content-Encoding']}\\1") end [status, headers, body] end end end
Version data entries
7 entries across 7 versions & 1 rubygems