So I have the `thingy` key ```json { // ... "httpEtag": "\"9dc673463c0e68b0d7eb86708309f232\"",

So I have the
thingy
key

{
  // ...
  "httpEtag": "\"9dc673463c0e68b0d7eb86708309f232\"",
  "etag": "9dc673463c0e68b0d7eb86708309f232",
  // ...
  "key": "thingy"
}


Since the
etag
is
9dc673463c0e68b0d7eb86708309f232
, I'd expect that a
put()
with
onlyIf.etagDoesNotMatch: '9dc673463c0e68b0d7eb86708309f232'
would do nothing - but instead throws an
internal error
.

// curl -X PUT http://localhost:8787 --header 'If-None-Match: "9dc673463c0e68b0d7eb86708309f232"'

await env.R2.put('thingy', 'waffles', {
  // @ts-ignore
  onlyIf: req.headers
})

// Uncaught (in promise) Error: internal error


If I change
.put
to
.get
and remove
'waffles'
, conditionals work as expected
Was this page helpful?