diff --git a/config/application.rb b/config/application.rb index d1aaa2507..abd26f4c4 100644 --- a/config/application.rb +++ b/config/application.rb @@ -56,7 +56,7 @@ module Chatwoot # Application configuration can go into files in config/initializers # -- all .rb files in that directory are automatically loaded after loading # the framework and any gems in your application. - config.middleware.use FazerAiPlatformHeader + config.middleware.use Middleware::FazerAiPlatformHeader config.generators.javascripts = false config.generators.stylesheets = false diff --git a/lib/middleware/fazer_ai_platform_header.rb b/lib/middleware/fazer_ai_platform_header.rb index f20f1a3ff..1dd760541 100644 --- a/lib/middleware/fazer_ai_platform_header.rb +++ b/lib/middleware/fazer_ai_platform_header.rb @@ -1,13 +1,15 @@ # frozen_string_literal: true -class FazerAiPlatformHeader - def initialize(app) - @app = app - end +module Middleware # rubocop:disable Style/ClassAndModuleChildren + class FazerAiPlatformHeader + def initialize(app) + @app = app + end - def call(env) - status, headers, response = @app.call(env) - headers['X-Platform'] = 'fazer.ai' - [status, headers, response] + def call(env) + status, headers, response = @app.call(env) + headers['X-Platform'] = 'fazer.ai' + [status, headers, response] + end end end