1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

F #3167: Add User-Agent for enterprise and GH reqs

This commit is contained in:
Tino Vazquez 2019-04-05 17:09:48 +02:00
parent 5281803a87
commit 3e1d571604
No known key found for this signature in database
GPG Key ID: 2FE9C32E94AEABBE

View File

@ -225,6 +225,8 @@ get '/support/check' do
http = Curl.get(url) do |http_options|
token_enc = Base64.strict_encode64($conf[:token_remote_support])
http_options.headers['Authorization'] = 'Basic ' + token_enc
http_options.headers['User-Agent'] =
'OpenNebula Subscription Validation'
end
rescue StandardError
[400, JSON.pretty_generate(:pass => false)]
@ -254,7 +256,7 @@ get '/support/check/version' do
begin
http = Curl.get(GITHUB_TAGS_URL) do |http_options|
http_options.headers['User-Agent'] = 'One'
http_options.headers['User-Agent'] = 'OpenNebula Version Validation'
end
rescue StandardError
return [400, JSON.pretty_generate(:version => 0)]