-
Notifications
You must be signed in to change notification settings - Fork 333
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
π Bug Report β Inconsistent etag parsing error in R2 bindings api #1967
Comments
Spoke with @flakey5 about this a bit offline but posting here also... the etag |
Fwiw last time I checked the R2 bindings will consistently throw an error for some etag errors (off the top of my head I remember unquoted etags) but the error messages were very vague and took a bit to figure out what the actual problem was |
As y'all noticed these are in fact invalid with the quotations. The error there isn't very helpful, we ought to improve the messaging. I think it'd make sense to remove this header parsing out of workerd and into R2s API implementation. |
@harshal317 FWIW the current etag parsing logic in the R2 API used for S3 and public buckets is not compliant with rfc9110, so just switching to that would be a breaking change. Specifically I believe that it doesn't deal well with etag arrays with multiple commas like As far as I know, this implementation in workerd accepts every etag rfc9110 requires it to, but also more. For example, I don't believe that an etag like Unfortunately you can't switch to an implementation that is equivalent to this one because I believe the R2 API implementation accepts etags wrapped in multiple quotes like As far as I know is also difficult to create an implementation that encompasses both current implementations in laxness, because then it will become very difficult to know how to separate etags from eachother, since neither commas nor quotes can be used to separate them. That said, moving this into the R2 API can make sense, but I think you'd probably need a separate implementation. If it's just about wanting to have this logic in JS, maybe it's worth to bite the bullet on converting some of our bindings to JS. |
Background
request.headers
object into the R2Object.get()'sonlyIf
andrange
options.Issue
Last week, we started seeing a client pass in conditional headers that wrapped the etags in quotes (e.g.
"W/"5a49a0bd-39326""
or""asd123""
). Sometimes this error is thrown, other times it isn't.Repro
The Question
Is that etag format supported or something we need to validate before passing in?
The text was updated successfully, but these errors were encountered: