workerd
workerd copied to clipboard
🐛 Bug Report — Runtime APIs - R2Conditional parses wildcard etag as strong etag
Was looking into this issue here: https://github.com/cloudflare/workers-sdk/issues/6411
Specifically when using the R2Conditional type when passing in an onlyIf option for R2_BINDING.put() we parse this as a strong etag regardless of the content
https://github.com/cloudflare/workerd/blob/8cf46289709352b8c8e5e16718e3231cab48689b/src/workerd/api/r2-bucket.c%2B%2B#L965-L983
As a result when the conditional check is done in the R2 layer the condition which is meant to always be true when an object exists ends up being false.
Mostly creating this for tracking, I'll take a stab at updating the runtime to build a wildcard etag when we are passed a *