A valid entity-tag can be distinguished from a valid HTTP-date by examining the first three characters for a DQUOTE.
To my understanding this is because an etag must start with either " or W/", but if so, this means the phrasing can be more precise:
A valid entity-tag can be distinguished from a valid HTTP-date by examining the first and third characters for a DQUOTE.
This also better clarifies why it works (otherwise the reader may infer that checking the second character is also needed, causing her to question her understanding of the syntax) and makes for more efficient implementations (micro-optimized, but still). In any case an implementation is free to check all three characters, or the whole string, or any other way it likes. Actually, wouldn't it also be enough to only check the last character for a DQUOTE?
Further, since the client MUST NOT generate an If-Range header field containing an entity tag that is marked as weak, isn't it sufficient to only check the first character for a DQUOTE?
RFC9110 section 13.1.5 states:
To my understanding this is because an etag must start with either
"
orW/"
, but if so, this means the phrasing can be more precise:This also better clarifies why it works (otherwise the reader may infer that checking the second character is also needed, causing her to question her understanding of the syntax) and makes for more efficient implementations (micro-optimized, but still). In any case an implementation is free to check all three characters, or the whole string, or any other way it likes. Actually, wouldn't it also be enough to only check the last character for a DQUOTE?