jshttp / fresh

HTTP request freshness testing
MIT License
161 stars 28 forks source link

Support weak ETags #11

Closed dougwilson closed 9 years ago

dougwilson commented 10 years ago

This module should support weak ETags properly :) I plan to make a PR at a later time, but wanted to file this to not forget/maybe someone else will do it first :)

Since this module is for conditional requests, it should do weak validations. Right now W/"1" doesn't correctly match "1" in weak validation.

HTTPbis has the official matching chart at: http://tools.ietf.org/html/draft-ietf-httpbis-p4-conditional-26#section-2.3.2

dougwilson commented 10 years ago

Edit: I updated the issue to reflect that this module just does conditional GET checking, not general ETag comparisons :)

jonathanong commented 10 years ago

@visionmedia add @dougwilson as maintainer as well?

dougwilson commented 10 years ago

Or just add us as owners and we can move them or whatever if you're not interested any more :) We promise to make you proud.

jonathanong commented 10 years ago

@visionmedia move to @jshttp?

@dougwilson what did you think the next API should be? i think we should be returning a string, i.e. false || 'weak' || 'strong' and maybe another option for the max-age=0 issue if we can think of a fix. should be pretty backwards compatible and better for frameworks

dougwilson commented 10 years ago

what did you think the next API should be?

i have to look into it more, still, but return values don't particularly work that way; it would likely be input options that state what kind of resource it is and why you need to check the freshness, since those factor into how the check functions.

jonathanong commented 10 years ago

oh what didn't realize that strong/weak etags matched like that