Sha256: 2f94567d68f1de05e1b50c437bff9e5a36014e56f3346ac9627190a6d297c8dc

Contents?: true

Size: 601 Bytes

Versions: 8

Compression:

Stored size: 601 Bytes

Contents

module Restfulie::Client::Feature

  class SetupHeader
    
    def execute(flow, request, env)
      headers = request.default_headers.dup.merge(request.headers)
      host = request.host
      if host.user || host.password
        headers["Authorization"] = "Basic " + ["#{host.user}:#{host.password}"].pack("m").delete("\r\n")
      end
      headers.delete :recipe
      headers['cookie'] = request.cookies if request.cookies
      
      # gs: this should not be overriden, do it in some other way
      request.headers = headers
      
      flow.continue(request, env)
    end
    
  end
  
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
restfulie-nosqlite-1.0.4 lib/restfulie/client/feature/setup_header.rb
restfulie-1.1.1 lib/restfulie/client/feature/setup_header.rb
restfulie-1.1.0 lib/restfulie/client/feature/setup_header.rb
restfulie-nosqlite-1.0.3 lib/restfulie/client/feature/setup_header.rb
restfulie-1.0.3 lib/restfulie/client/feature/setup_header.rb
restfulie-1.0.0 lib/restfulie/client/feature/setup_header.rb
restfulie-1.0.0.beta5 lib/restfulie/client/feature/setup_header.rb
restfulie-1.0.0.beta4 lib/restfulie/client/feature/setup_header.rb