Sha256: 55489e6e2d8dfba53de4e78802669357b02c4edb881d0f723a28de916ba7884e
Contents?: true
Size: 519 Bytes
Versions: 10
Compression:
Stored size: 519 Bytes
Contents
require 'rack/utils' 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
10 entries across 10 versions & 1 rubygems