Since 2016-10-15 a redirect to a signup page has been implemented.

This commit is contained in:
Martin Edenhofer 2016-10-15 04:31:15 +02:00
parent dfdfb15d43
commit f5de9086b7

View file

@ -23,7 +23,7 @@ class ImportZendeskController < ApplicationController
'Connection refused' => 'Connection refused!',
}
response = UserAgent.request( params[:url] )
response = UserAgent.request(params[:url])
if !response.success?
message_human = ''
@ -40,6 +40,15 @@ class ImportZendeskController < ApplicationController
return
end
# since 2016-10-15 a redirect to a signup page has been implemented
if response.body =~ /(Take it for a risk-free|Take it for a risk-free)/i
render json: {
result: 'invalid',
message_human: 'Hostname not found!',
}
return
end
Setting.set('import_zendesk_endpoint', "#{params[:url]}api/v2")
render json: {