changed http based tests, added #scheme, using it to correctly set no proxy domain

This commit is contained in:
HoneyryderChuck 2023-03-29 23:00:50 +01:00
parent 8652d1978f
commit df26c97e38
3 changed files with 9 additions and 5 deletions

View File

@ -100,7 +100,7 @@ class HTTPTest < Minitest::Test
private
def origin(orig = httpbin)
"http://#{orig}"
def scheme
"http://"
end
end

View File

@ -180,7 +180,7 @@ class HTTPSTest < Minitest::Test
private
def origin(orig = httpbin)
"https://#{orig}"
def scheme
"https://"
end
end

View File

@ -23,6 +23,10 @@ module HTTPHelpers
end
def httpbin_no_proxy
URI(ENV.fetch("HTTPBIN_NO_PROXY_HOST", "httpbin.org"))
URI(ENV.fetch("HTTPBIN_NO_PROXY_HOST", "#{scheme}httpbin.org"))
end
def origin(orig = httpbin)
"#{scheme}#{orig}"
end
end