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

HTTParty permanently overrides default request headers of Net::HTTP #506

Closed
qsona opened this issue Jan 5, 2017 · 1 comment
Closed

Comments

@qsona
Copy link

qsona commented Jan 5, 2017

Version

httparty 0.13.7
(Ruby on Rails 4.2.6)

Reproduce Steps

  1. HTTParty.get('http://httpstat.us/204', debug_output: $stdout)
    request log:
    <- "GET /204 HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nUser-Agent: Ruby\r\nConnection: close\r\nHost: httpstat.us\r\n\r\n"

  2. HTTParty.get('http://httpstat.us/204', headers: {}, debug_output: $stdout)
    request log:
    <- "GET /204 HTTP/1.1\r\nConnection: close\r\nHost: httpstat.us\r\n\r\n"

  3. HTTParty.get('http://httpstat.us/204', debug_output: $stdout)
    request log:
    <- "GET /204 HTTP/1.1\r\nConnection: close\r\nHost: httpstat.us\r\n\r\n"

On the second request, I specified headers: {} option, then the default headers (Accept-Encoding, Accept, User-Agent) are removed. And after that, even if I don't specified headers option, these headers don't come back.

@jnunemaker
Copy link
Owner

Closed by #518

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants