class SabayonMiddleware::Middleware
Constants
- HEADERS
Attributes
app[R]
pairs[R]
Public Class Methods
new(app, variables = ENV)
click to toggle source
# File lib/sabayon_middleware/middleware.rb, line 4 def initialize(app, variables = ENV) @app = app @pairs = SabayonMiddleware::Pairs.call(variables) end
Public Instance Methods
call(env)
click to toggle source
# File lib/sabayon_middleware/middleware.rb, line 9 def call(env) pairs.each do |token, key| if env["PATH_INFO"] == "/.well-known/acme-challenge/#{token}" return [200, HEADERS, [key]] end end app.call(env) end