question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Etag filter is broken: prevents content from being sent from the server

See original GitHub issue

The 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:closed
  • Created a year ago
  • Comments:18 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
daviddentoncommented, May 18, 2022

I’ve deprecated the eTag filter in favour of eTagSupport, so I think we’re done here as far as http4k is concerned?

1reaction
jshiellcommented, May 16, 2022

@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 of ETagSupport. Looking at the history, it looks like some handsome fellow contributed EtagSupport as a fuller implementation of handling, but AddETag was never deleted. Probably because Dave has it in for me 😁

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found