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

Incorrect Rack::ETag behaviour #681

Closed
stevegraham opened this issue May 1, 2014 · 3 comments
Closed

Incorrect Rack::ETag behaviour #681

stevegraham opened this issue May 1, 2014 · 3 comments
Milestone

Comments

@stevegraham
Copy link

@stevegraham stevegraham commented May 1, 2014

Rack::ETag is a MD5 digest of the response body. The same response body with different response headers will yield the same ETag. This is a problem if the server is using headers to communicate policy or as part of the resource representation.

See similar issue with CouchDB for a better explanation.

I'm happy to contribute this patch myself, but in the Rack spec it only says that body element must respond to each, i.e. there are no guarantees it responds to other Enumerable method, e.g. any?. Can someone clarify whether it is OK to assume the receiver responds to those? Or is the only way to enumerate the body?

@stevegraham

This comment has been minimized.

Copy link
Author

@stevegraham stevegraham commented May 6, 2014

Anyone?

@raggi

This comment has been minimized.

Copy link
Member

@raggi raggi commented Jul 5, 2014

Accepting for 1.6 timeline.

@raggi

This comment has been minimized.

Copy link
Member

@raggi raggi commented Aug 3, 2014

The only way to enumerate the body is with each. You are free in user code to test for other things, but conforming middleware and servers can only assume each.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.