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

If-Range distinguishing entity-tag from HTTP-date can be more refined #1103

Open
amichair opened this issue Apr 13, 2023 · 1 comment
Open

Comments

@amichair
Copy link

RFC9110 section 13.1.5 states:

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?

@amichair
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant