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 cannot be used correctly with etags #194

Open
lolbinarycat opened this issue Oct 28, 2024 · 3 comments
Open

If-Range cannot be used correctly with etags #194

lolbinarycat opened this issue Oct 28, 2024 · 3 comments
Labels
breaking-change rfc Request for comments. More discussion would help move this along.

Comments

@lolbinarycat
Copy link

a weak entity tag must not be used with If-Range, but there is no easy way to check if an ETag is weak.

additionally, IfRange::etag is infallible, which means it is very easy to create an incorrect implementation.

@seanmonstar
Copy link
Member

Indeed! RFC 9110 Section 13.1.5:

A client MUST NOT generate an If-Range header field containing an entity tag that is marked as weak.

Welp, that's an unfortunate oversight. We can include adjustments in the next breaking change (which are not as catastrophic, since the trait is separate from the impls.) Would do well to design what the changes are here.

@seanmonstar seanmonstar added rfc Request for comments. More discussion would help move this along. breaking-change labels Oct 28, 2024
@lolbinarycat
Copy link
Author

At the very least we should add an is_weak method to ETag so this can be mitigated in the meantime.

@lolbinarycat
Copy link
Author

somewhat related, there's no way to get the string of an etag so i can nicely print it in error messages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change rfc Request for comments. More discussion would help move this along.
Projects
None yet
Development

No branches or pull requests

2 participants