-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
admin: Making Etag
a header, not a trailer
#6208
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This LGTM.
The only thing I would consider is adding a backdoor pool for the buffer. Would you like to do that in this PR? We can always do it later too.
PS. Your contribution is quite timely, here's a complaint from someone about the lack of Trailer support in clients:
https://twitter.com/fredkisss/status/1774726559066177560
Regarding this PR (and the config in the docs), I wanted to inform that it seems like the Trailer header is not well supported by many languages.
I am writing an app in python that needs to interface with caddy config API and I want to handle concurrent requests to caddy config API, but it seems like there is no http lib in python that supports reading it, so I am at lost.
I even tried to do in JS, but it isn't supported by browsers at all have been removed from the
fetch
spec (API that is used in JS to make http requests).What I have noticed is a lack of any library, browser or language wanting to support http trailers in response the body.
I'm a little bummed that Trailer support is so lacking still in 2024 :( Here's to a less efficient server API 🥂
Thanks! I have added a backdoor... err, I mean a sync.Pool. Please let me know if there are any implementation mistakes. Thank you. |
3135727
to
9d6cf41
Compare
Etag
a header, not a trailer
Not only in clients: quic-go/quic-go#2266 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for using a buffer pool and commenting the code.
This is based on @mholt's comment on an earlier PR.
I have used the very simple approach suggested by an earlier comment of first writing to a buffer, and then writing the buffer onto the response writer so as to have time to write the eTag as the header.
This probably requires some iterations. I would be grateful for suggestions by reviewers and the community on testing this out / making the implementation better.