2019-09-04 21:01:54 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-10-11 01:57:18 +05:30
|
|
|
# rubocop:disable Rails/ApplicationController
|
2019-09-04 21:01:54 +05:30
|
|
|
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-10-11 01:57:18 +05:30
|
|
|
# rubocop:enable Rails/ApplicationController
|