Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option for Hackney to not append library headers #529

Open
yuchunc opened this issue Sep 12, 2018 · 3 comments
Open

Option for Hackney to not append library headers #529

yuchunc opened this issue Sep 12, 2018 · 3 comments

Comments

@yuchunc
Copy link

yuchunc commented Sep 12, 2018

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!

@benoitc
Copy link
Owner

benoitc commented Sep 12, 2018

which headers are we talking about?

@benoitc
Copy link
Owner

benoitc commented Sep 12, 2018

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.

@yuchunc
Copy link
Author

yuchunc commented Sep 16, 2018

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!

@benoitc benoitc self-assigned this Sep 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants