jshttp / fresh

HTTP request freshness testing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support weak ETags

dougwilson opened this issue · comments

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

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

@visionmedia add @dougwilson as maintainer as well?

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.

@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

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.

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