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