Sha256: 509b509a1fb8dcd02a4afbf5ac138ad98b88e7ca0d18b3907567a86941660573

Contents?: true

Size: 590 Bytes

Versions: 55

Compression:

Stored size: 590 Bytes

Contents

module Fiona7
  module Middleware
    class ServerDetectionMiddleware
      class << self
        attr_accessor :server_detected
        attr_accessor :server_name, :server_port

        def server_detected?
          !!server_detected
        end
      end

      self.server_detected = false

      def initialize(app)
        @app = app
      end

      def call(env)
        self.class.server_detected = true
        self.class.server_name = env['SERVER_NAME']
        self.class.server_port = (env['SERVER_PORT'].presence || 80).to_i
        @app.call(env)
      end
    end
  end
end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
infopark_fiona7-1.2.0.0.0 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-1.1.0.0.9 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-1.1.0.0.8 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-1.1.0.0.7 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-1.1.0.0.6 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-1.1.0.0.5 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-1.1.0.0.4 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-1.1.0.0.3 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-1.1.0.0.2 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-1.1.0.0.10 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-1.1.0.0.1 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-1.1.0.0.0 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-0.71.1.9 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-0.71.1.8 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-0.71.1.7 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-0.71.1.6 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-0.71.1.5 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-0.71.1.4 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-0.71.1.3 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-0.71.1.2 lib/fiona7/middleware/server_detection_middleware.rb