ApiClient doesn't return custom headers
jwoertink opened this issue · 1 comments
jwoertink commented
If you have an action that sets a custom header, then you want to test that the header is returned, the ApiClient
doesn't seem to have those.
I'm not totally sure, but maybe because it rebuilds a new response object?
lucky/src/lucky/base_http_client.cr
Line 149 in 22fcb18
class SomeAction < ApiAction
get "/foo" do
response.headers["X-TEST"] = "test"
json({response: "ok"})
end
end
client = ApiClient.new
response = client.exec(SomeAction)
response.headers["X-TEST"] # does not exist
jwoertink commented
ugh... ok, this was just my bad. Something I was doing in my app...