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

Why is the "Keep-Alive" header an integer? #18

Closed
tdutreui-solocal opened this issue Oct 4, 2023 · 3 comments
Closed

Why is the "Keep-Alive" header an integer? #18

tdutreui-solocal opened this issue Oct 4, 2023 · 3 comments

Comments

@tdutreui-solocal
Copy link

tdutreui-solocal commented Oct 4, 2023

Hi,
I observe that this gem generates the following headers in my Rspec VCR cassettes :

      Connection:
      - keep-alive
      Keep-Alive:
      - '30'

On the other hand, I see in the MDN docs that Keep-Alive should be a key/value string.
Could you explain me why?
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Keep-Alive

@iMacTia
Copy link
Member

iMacTia commented Oct 12, 2023

Hi @tdutreui-solocal we don't set this header in this gem, it gets set somewhere down in the dependencies by either net-http-persistent or net-http.
You can see in net-http-persistent documentation that 30 is the default value: https://github.com/drbrain/net-http-persistent/blob/c1fb1a5ca29c4c2a7102138af22529cc78adb06e/lib/net/http/persistent.rb#L316-L325.

Although I agree with you that the default value should conform to the RFC (assuming the RFC enforces the key/value structure, the MDN docs are not official specifications), but that goes beyond the scope of this gem, so my suggestion is to open an issue against net-http-persistent instead.

@iMacTia iMacTia closed this as completed Oct 12, 2023
@tdutreui-solocal
Copy link
Author

Indeed there is already one drbrain/net-http-persistent#136

@iMacTia
Copy link
Member

iMacTia commented Oct 12, 2023

Thank you for sharing the link!

@tdutreui-solocal tdutreui-solocal changed the title Why is the "Keep-Alive" an integer? Why is the "Keep-Alive" header an integer? Oct 12, 2023
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