feature #3819: Add ssl proxy url to the onegate con

(cherry picked from commit 88d4825be2d48feebb210a4323e523490f0cee67)
This commit is contained in:
Daniel Molina committed 2015-11-06 16:31:10 +01:00
1 parent 838f64d5ad
commit 034f6ab8ee
2 files changed
+10 -4

No files matched your search

+3
View File
@@ -27,6 +27,9 @@
:host: 127.0.0.1
:port: 5030
# SSL proxy URL that serves the API (set if is being used)
#:ssl_server: https://service.endpoint.fqdn:port/
################################################################################
# Log
################################################################################
+7 -4
View File
@@ -242,10 +242,13 @@ get '/' do
client = authenticate(request.env, params)
halt 401, "Not authorized" if client.nil?
protocol = request.env["rack.url_scheme"]
host = request.env["HTTP_HOST"]
base_uri = "#{protocol}://#{host}"
if $conf[:ssl_server]
base_uri = $conf[:ssl_server]
else
protocol = request.env["rack.url_scheme"]
host = request.env["HTTP_HOST"]
base_uri = "#{protocol}://#{host}"
end
response = {
"vm_info" => "#{base_uri}/vm",