Sha256: 38c8295ce122c90076071838e8b07cbf179004edb2d111ae74b717178788f0ac

Contents?: true

Size: 894 Bytes

Versions: 6

Compression:

Stored size: 894 Bytes

Contents

# frozen_string_literal: true

module RailsSpotlight
  module Middlewares
    module Handlers
      class VerifyActionHandler < BaseActionHandler
        def execute; end

        private

        def text_response_body
          "Rails Spotlight is working!\nRails version: #{Rails.version}\nRails environment: #{Rails.env}"
        end

        def json_response_body
          {
            params: request.params,
            body: request.body.read,
            content_type: request.content_type,
            request_method: request.request_method,
            version: request.get_header('HTTP_X_RAILS_SPOTLIGHT'),
            current_gem_version: ::RailsSpotlight::VERSION,
            project: ::RailsSpotlight.config.project_name,
            action_cable_path: defined?(ActionCable) ? ActionCable&.server&.config&.mount_path : nil
          }
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rails_spotlight-0.2.5 lib/rails_spotlight/middlewares/handlers/verify_action_handler.rb
rails_spotlight-0.2.4 lib/rails_spotlight/middlewares/handlers/verify_action_handler.rb
rails_spotlight-0.2.3 lib/rails_spotlight/middlewares/handlers/verify_action_handler.rb
rails_spotlight-0.2.2 lib/rails_spotlight/middlewares/handlers/verify_action_handler.rb
rails_spotlight-0.2.1 lib/rails_spotlight/middlewares/handlers/verify_action_handler.rb
rails_spotlight-0.2.0 lib/rails_spotlight/middlewares/handlers/verify_action_handler.rb