mamantoha / crest

HTTP and REST client for Crystal
https://mamantoha.github.io/crest/
MIT License
235 stars 14 forks source link

Bug: Request headers get merged into Response #201

Closed m-o-e closed 1 year ago

m-o-e commented 1 year ago

On Crystal 1.7.0, crest 1.3.7:

require "crest"

r = Crest::Resource.new(
  "http://httpbin.org",
  headers: { "Foo" => "bar" },
)

response = r.get("/get")
p response.headers

Output:

{"Foo" => "bar", "Date" => "Fri, 13 Jan 2023 23:37:49 GMT", "Content-Type" => "application/json", "Content-Length" => "330", "Connection" => "keep-alive", "Server" => "gunicorn/19.9.0", "Access-Control-Allow-Origin" => "*", "Access-Control-Allow-Credentials" => "true"}