2019-06-06 18:55:31 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-09-14 15:12:56 +00:00
|
|
|
# rubocop:disable Rails/ApplicationController
|
2019-06-06 18:55:31 +00:00
|
|
|
class AcmeChallengesController < ActionController::Base
|
|
|
|
def show
|
|
|
|
if acme_order
|
|
|
|
render plain: acme_order.challenge_file_content, content_type: 'text/plain'
|
|
|
|
else
|
|
|
|
head :not_found
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def acme_order
|
|
|
|
@acme_order ||= PagesDomainAcmeOrder.find_by_domain_and_token(params[:domain], params[:token])
|
|
|
|
end
|
|
|
|
end
|
2022-09-14 15:12:56 +00:00
|
|
|
# rubocop:enable Rails/ApplicationController
|