diff --git a/app/controllers/import_zendesk_controller.rb b/app/controllers/import_zendesk_controller.rb index 837635772..2b517e7ff 100644 --- a/app/controllers/import_zendesk_controller.rb +++ b/app/controllers/import_zendesk_controller.rb @@ -23,7 +23,7 @@ class ImportZendeskController < ApplicationController 'Connection refused' => 'Connection refused!', } - response = UserAgent.request(params[:url], verify_ssl: true) + response = UserAgent.request(URI.join(params[:url], '/api/v2/users/me').to_s, verify_ssl: true) if !response.success? message_human = '' @@ -40,8 +40,7 @@ class ImportZendeskController < ApplicationController return end - # since 2016-10-15 a redirect to a marketing page has been implemented - if response.body.exclude?(params[:url]) + if response.header['x-zendesk-api-version'].blank? render json: { result: 'invalid', message_human: 'Hostname not found!',