Sha256: 7aa903a83cc3522ed366c2d8a2b676cf1a511dd52f71745dcabd0d5137fad23d
Contents?: true
Size: 858 Bytes
Versions: 3
Compression:
Stored size: 858 Bytes
Contents
require 'faraday' module Infrataster module Contexts class HttpContext < BaseContext def response server.open_gateway_on_from_server(resource.uri.port) do |address, port| url = "#{resource.uri.scheme}://#{address}:#{port}" conn = Faraday.new(:url => url) do |faraday| faraday.request :url_encoded faraday.response :logger, Logger faraday.adapter Faraday.default_adapter end conn.public_send(resource.method) do |req| resource.params.each_pair do |k, v| req.params[k] = v end req.headers['Host'] = resource.uri.host resource.headers.each_pair do |k, v| req.headers[k] = v end req.url resource.uri.path end end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
infrataster-0.1.7 | lib/infrataster/contexts/http_context.rb |
infrataster-0.1.6 | lib/infrataster/contexts/http_context.rb |
infrataster-0.1.5 | lib/infrataster/contexts/http_context.rb |