X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/b9411e85079a76573f722febfdd5ab5e4c85c9f7..da87a814c360a8e1b5decf6ffa498e731748f247:/services/api/app/controllers/arvados/v1/healthcheck_controller.rb diff --git a/services/api/app/controllers/arvados/v1/healthcheck_controller.rb b/services/api/app/controllers/arvados/v1/healthcheck_controller.rb index 47b49ff46a..6d55506bb5 100644 --- a/services/api/app/controllers/arvados/v1/healthcheck_controller.rb +++ b/services/api/app/controllers/arvados/v1/healthcheck_controller.rb @@ -16,20 +16,20 @@ class Arvados::V1::HealthcheckController < ApplicationController before_filter :check_auth_header def check_auth_header - mgmt_token = Rails.configuration.management_token + mgmt_token = Rails.configuration.ManagementToken auth_header = request.headers['Authorization'] if !mgmt_token - send_error("disabled", status: 404) + send_json ({"errors" => "disabled"}), status: 404 elsif !auth_header - send_error("authorization required", status: 401) + send_json ({"errors" => "authorization required"}), status: 401 elsif auth_header != 'Bearer '+mgmt_token - send_error("authorization error", status: 403) + send_json ({"errors" => "authorization error"}), status: 403 end end def ping - resp = {"health": "OK"} + resp = {"health" => "OK"} send_json resp end end