hackney icon indicating copy to clipboard operation
hackney copied to clipboard

Option for Hackney to not append library headers

Open yuchunc opened this issue 7 years ago • 3 comments

Hi,

A third party API is very strict about request headers, it allows nothing but the ones documented. I’m using HTTPoison as REST client, but Hackney adds some header information, and the third party service would error. Is there some options I can set to disable this behaviour on Hackney? Or do I have to override the library module?

Thank you!

yuchunc avatar Sep 12 '18 10:09 yuchunc

which headers are we talking about?

benoitc avatar Sep 12 '18 10:09 benoitc

right now it's not posible. Some headers are added while performing the request:

https://github.com/benoitc/hackney/blob/master/src/hackney_request.erl#L37-L61

But an option can be added to only use user headers if needed. I would accept a patch for it. Just let me know.

benoitc avatar Sep 12 '18 13:09 benoitc

Hi @benoitc

I started #532 PR, sorry that I submitted it without tests, my erlang skill is very limited, and I couldn't figure out how to run erlang tests. The changes in this PR is the result of fiddling with code in /deps of my elixir project.

Are there some basic steps for getting the tests running (ie. install dependencies, execute test suite)? I can add the tests if I can just have a little bit of directions. :)

Thank you!

yuchunc avatar Sep 16 '18 17:09 yuchunc