class Katello::PreventJsonParsing

Public Class Methods

new(app, exclude) click to toggle source
# File lib/katello/prevent_json_parsing.rb, line 3
def initialize(app, exclude)
  @app = app
  @exclude = exclude
end

Public Instance Methods

call(env) click to toggle source
# File lib/katello/prevent_json_parsing.rb, line 8
def call(env)
  if @exclude&.call(env)
    env['CONTENT_TYPE'] = 'text/plain'
  end
  @app.call(env)
end