fix error
This commit is contained in:
parent
2d8efa35d1
commit
ee827ff711
|
@ -109,13 +109,14 @@ class Admin::RegisterApiController < ApplicationController
|
||||||
end
|
end
|
||||||
params_to_send = {'store_token' => store_token, "site_token" => params[:site_token]}
|
params_to_send = {'store_token' => store_token, "site_token" => params[:site_token]}
|
||||||
uri = URI.parse("http://#{params[:site_domain]}/")
|
uri = URI.parse("http://#{params[:site_domain]}/")
|
||||||
http = Net::HTTP.new(uri.host,uri.port)
|
|
||||||
request = Net::HTTP::Post.new("/store/confirmation")
|
request = Net::HTTP::Post.new("/store/confirmation")
|
||||||
request.body = params_to_send.to_query
|
request.body = params_to_send.to_query
|
||||||
begin
|
begin
|
||||||
success_flag = false
|
success_flag = false
|
||||||
begin
|
begin
|
||||||
response = http.request(request)
|
response = Net::HTTP.start(uri.host, uri.port,:use_ssl => uri.scheme == 'https',open_timeout: 10,read_timeout: 10,verify_mode: OpenSSL::SSL::VERIFY_NONE) do |http|
|
||||||
|
http.request request
|
||||||
|
end
|
||||||
success_flag = (response.code == '200')
|
success_flag = (response.code == '200')
|
||||||
rescue => e
|
rescue => e
|
||||||
end
|
end
|
||||||
|
@ -123,7 +124,7 @@ class Admin::RegisterApiController < ApplicationController
|
||||||
return response
|
return response
|
||||||
else
|
else
|
||||||
uri = URI("https://#{params[:site_domain]}/store/confirmation")
|
uri = URI("https://#{params[:site_domain]}/store/confirmation")
|
||||||
response = Net::HTTP.start(uri.host, uri.port,:use_ssl => uri.scheme == 'https',open_timeout: 30,read_timeout: 30,verify_mode: OpenSSL::SSL::VERIFY_NONE) do |http|
|
response = Net::HTTP.start(uri.host, uri.port,:use_ssl => uri.scheme == 'https',open_timeout: 10,read_timeout: 10,verify_mode: OpenSSL::SSL::VERIFY_NONE) do |http|
|
||||||
request = Net::HTTP::Post.new uri
|
request = Net::HTTP::Post.new uri
|
||||||
request.set_form_data(params_to_send)
|
request.set_form_data(params_to_send)
|
||||||
http.request request
|
http.request request
|
||||||
|
|
Loading…
Reference in New Issue