Fixes #3679 - Zendesk URL check fails with Net::HTTPForbidden 403 error.
This commit is contained in:
parent
f50016b008
commit
e9a442160b
1 changed files with 2 additions and 3 deletions
|
@ -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!',
|
||||
|
|
Loading…
Reference in a new issue