Sha256: 49765ff33065e0ae4f571576ff6e8ca3d5fdb3236e4137325b379f91fc935bf3
Contents?: true
Size: 298 Bytes
Versions: 21
Compression:
Stored size: 298 Bytes
Contents
class WwwMiddleware def initialize(app) @app = app end def call(env) request = Rack::Request.new(env) if request.host.starts_with?("www.") [301, {"Location" => request.url.sub("//www.", "//")}, self] else @app.call(env) end end def each(&block) end end
Version data entries
21 entries across 21 versions & 1 rubygems