Sha256: 8763b91f82eb594684b03d99658faf2b13ed6962bd9d07678e2db70fccfb041d

Contents?: true

Size: 569 Bytes

Versions: 3

Compression:

Stored size: 569 Bytes

Contents

require "rack/utf8_sanitizer"

module HandleInvalidPercentEncodingRequests

  class Engine < Rails::Engine
    initializer "handle_invalid_percent_encoding_requests.add_middleware" do |app|
      # Via http://stackoverflow.com/a/24727310/311657
      # NOTE: These must be in this order relative to each other.
      # The middleware just raises for encoding errors it doesn't cover,
      # so it must run after (= be inserted before) Rack::UTF8Sanitizer.
      app.middleware.insert 0, Middleware
      app.middleware.insert 0, Rack::UTF8Sanitizer
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
handle_invalid_percent_encoding_requests-1.0.2 lib/handle_invalid_percent_encoding_requests/engine.rb
handle_invalid_percent_encoding_requests-1.0.1 lib/handle_invalid_percent_encoding_requests/engine.rb
handle_invalid_percent_encoding_requests-1.0 lib/handle_invalid_percent_encoding_requests/engine.rb