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.6.1.1.5 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-1.6.1.1.1 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-1.6.1.1.0 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-1.2.0.2.3 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-1.2.0.2.1 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-1.2.0.2.2 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-1.5.5.5.1 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-1.5.5.5.0 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-1.2.0.1.4 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-1.5.5.4.1 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-1.5.5.4.0 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-1.2.0.1.3 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-1.5.5.3.1 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-1.5.4.3.0 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-1.5.3.2.0 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-1.5.3.2.0.pre.beta1 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-1.5.2.1.0.pre.beta1 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-1.5.2.0.0 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-1.2.0.1.1 lib/fiona7/middleware/server_detection_middleware.rb
infopark_fiona7-1.2.0.0.1 lib/fiona7/middleware/server_detection_middleware.rb