httpx/test/support/http_helpers.rb
HoneyryderChuck 2da56ce9af fix: keep connection alive if HTTP/1.1 and there is connection-related
header;

this was wrongly closing connections for HTTP/1.1 connections which
didn't send a "Connection" header; according to spec, the default is
"Keep-Alive", contrary to HTTP/1.0
2019-05-15 14:45:06 +00:00

25 lines
441 B
Ruby

# frozen_string_literal: true
require_relative "../test_helper"
require_relative "assertion_helpers"
module HTTPHelpers
include ResponseHelpers
private
def build_uri(suffix = "/")
"#{origin}#{suffix || "/"}"
end
def json_body(response)
raise response.status if response.is_a?(HTTPX::ErrorResponse)
JSON.parse(response.body.to_s)
end
def httpbin
ENV.fetch("HTTPBIN_HOST", "nghttp2.org/httpbin")
end
end