class AcmeChallenge

Constants

VERSION

Attributes

app[RW]
key[RW]
secret[RW]

Public Class Methods

new(app, challenge) click to toggle source
# File lib/acme_challenge.rb, line 4
def initialize(app, challenge)
  self.app = app
  self.key, self.secret = challenge.split('.')
end

Public Instance Methods

call(env) click to toggle source
# File lib/acme_challenge.rb, line 9
def call(env)
  path = env['PATH_INFO']
  if path == "/.well-known/acme-challenge/#{key}"
    return [200, {'Content-Type' => 'text/plain'}, ["#{key}.#{secret}"]]
  end

  app.call(env)
end