gitlab-org--gitlab-foss/app/controllers/acme_challenges_controller.rb

20 lines
472 B
Ruby

# frozen_string_literal: true
# rubocop:disable Rails/ApplicationController
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
# rubocop:enable Rails/ApplicationController