Etag filter is broken: prevents content from being sent from the server
See original GitHub issueThe Etag filter was previously broken, using the response from toString
to generate the hash.
An attempt to fix this was pushed in commit: 4f1491f5ad2cdd09b1e7a8d94ab97d3f581966bf
A subsequent commit simplified the code (but left it still in a broken state): 5a8d989859bfa4e863b4adc534dbea967474387d - reading the byte array in this way moves the pointer and results in the HTTP response containing a valid Etag, but a 0 length payload!
Issue Analytics
- State:
- Created a year ago
- Comments:18 (8 by maintainers)
Top Results From Across the Web
Demystify ETag - LinkedIn
The filter then gets the hash of the request from the request attributing, thus reducing the computation, then computes the response hash and ......
Read more >ETag - HTTP - MDN Web Docs
The ETag (or entity tag) HTTP response header is an identifier for a specific version of a resource. It lets caches be more...
Read more >Python etag/last modified not working; how to get latest rss
Your issue is that you are passing in the last modified date in place of the etag . The etag is the second...
Read more >Etag caching broken using many popular HTTP servers · Issue ...
The client already knows the ETag (it must!) since it provided with the request, so providing it in the response is absolutely redundant....
Read more >How to prevent Etag tracking with Firefox? How to delete ...
Javascript won't work against preventing Etag tracking. This is an HTTP "feature" to reduce load on the server in not having to redeliver...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve deprecated the eTag filter in favour of eTagSupport, so I think we’re done here as far as http4k is concerned?
@stevebakh nope, I’m suggesting that the framework should never break a stream, even if that means it cannot add etags. Given we don’t know the context, I’d be very wary of adding even a weak tag to a stream - I think this is a case that needs to be addressed by the app dev.
But we should certainly add them for in-memory responses, and handle 304s where we match.
I think we should delete
AddETag
in favour ofETagSupport
. Looking at the history, it looks like some handsome fellow contributedEtagSupport
as a fuller implementation of handling, butAddETag
was never deleted. Probably because Dave has it in for me 😁