def prepare_env(faraday_env)
      env = headers_to_rack(faraday_env)

      url = faraday_env[:url]
      env['rack.url_scheme'] = url.scheme
      env['PATH_INFO'] = url.path
      env['SERVER_PORT'] = url.respond_to?(:inferred_port) ? url.inferred_port : url.port
      env['QUERY_STRING'] = url.query
      env['REQUEST_METHOD'] = faraday_env[:method].to_s.upcase

      env['rack.errors'] ||= StringIO.new
      env['faraday'] = faraday_env

      env
    end
def prepare_env(faraday_env)
      env = headers_to_rack(faraday_env)

      url = faraday_env[:url]
      env['rack.url_scheme'] = url.scheme
      env['PATH_INFO'] = url.path
      env['SERVER_PORT'] = url.respond_to?(:inferred_port) ? url.inferred_port : url.port
      env['QUERY_STRING'] = url.query
      env['REQUEST_METHOD'] = faraday_env[:method].to_s.upcase

      env['rack.errors'] ||= StringIO.new
      env['faraday'] = faraday_env

      env
    end
faraday to rack-compatible