Unverified Commit 161e1607 authored by Miguel E. Ruiz's avatar Miguel E. Ruiz Committed by GitHub
Browse files

B OpenNebula/one-apps#7231: Fix `onegate` client in context (#273)

parent 7fb0d0a7
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -443,6 +443,7 @@ module OneGate
        def initialize(opts={})
            @vmid = ENV["VMID"]
            @token = ENV["TOKENTXT"]
            @content_type = opts[:content_type] || 'application/json'

            url = opts[:url] || ENV['ONEGATE_ENDPOINT']
            @uri = URI.parse(url)
@@ -476,6 +477,7 @@ module OneGate
        def post(path, body)
            req = Net::HTTP::Proxy(@host, @port)::Post.new(path)
            req.body = body
            req.content_type = @content_type

            do_request(req)
        end
@@ -483,6 +485,7 @@ module OneGate
        def put(path, body)
            req = Net::HTTP::Proxy(@host, @port)::Put.new(path)
            req.body = body
            req.content_type = @content_type

            do_request(req)
        end