https://discord.cloudflare.com logo
Join Discord
Powered by
# r2
  • v

    Vitali

    05/01/2022, 12:40 AM
    That's what I figured
  • v

    Vitali

    05/01/2022, 12:40 AM
    Can you build on top of that PR until it works? I gotta go get some dinner
  • v

    Vitali

    05/01/2022, 12:40 AM
    One of x-amz-date and date is required by the spec
  • v

    Vitali

    05/01/2022, 12:41 AM
    To make sure there's no replay attacks
  • e

    Erisa | Support Engineer

    05/01/2022, 12:41 AM
    well the thing is that it is there
  • v

    Vitali

    05/01/2022, 12:41 AM
    Must be an invalid format
  • e

    Erisa | Support Engineer

    05/01/2022, 12:41 AM
  • v

    Vitali

    05/01/2022, 12:42 AM
    That's very strange
  • e

    Erisa | Support Engineer

    05/01/2022, 12:42 AM
    when i look at the docs () it gives an example of
    20150830T123600Z
    which seems to be the same format as that one above as far as i can tell?
  • v

    Vitali

    05/01/2022, 12:43 AM
    Yup
  • v

    Vitali

    05/01/2022, 12:43 AM
    Here's where the code you're hitting is:
    Copy code
    let requestDate = request.headers.get('x-amz-date')
      let dateOrigin: 'x-amz-date' | 'date' = 'x-amz-date'
      if (!requestDate) {
        // x-amz-date takes precedence over date
        requestDate = request.headers.get('date')
        if (!requestDate) {
          return errors.invalidArgument(
            { account },
            'No date provided in x-amz-date nor date header',
          )
        }
        dateOrigin = 'date'
      }
  • v

    Vitali

    05/01/2022, 12:43 AM
    I don't know what's going on (pretty sure the get is case insensitive)
  • v

    Vitali

    05/01/2022, 12:44 AM
    can you redo the request again?
  • e

    Erisa | Support Engineer

    05/01/2022, 12:44 AM
    redone
  • v

    Vitali

    05/01/2022, 12:45 AM
    Here's what wrangler tail is showing me:
    Copy code
    "method": "PUT",
          "headers": {
            "accept-encoding": "gzip",
            "cf-connecting-ip": "<REDACTED>",
            "cf-ipcountry": "GB",
            "cf-ray": "70447d9d3f3276d8",
            "cf-visitor": "{\"scheme\":\"https\"}",
            "connection": "Keep-Alive",
            "content-length": "10",
            "content-md5": "sFQDISxmvcjMxZf+32zV/g==",
            "content-type": "text/plain; charset=utf-8",
            "host": "<REDACTED>.r2.cloudflarestorage.com",
            "user-agent": "rclone/v1.59.0-beta.6112.3f5bed51d.fix-missing-sigv4-header",
            "x-amz-acl": "private",
            "x-amz-content-sha256": "UNSIGNED-PAYLOAD",
            "x-amz-meta-mtime": "1651242675.438993951",
            "x-forwarded-proto": "https",
            "x-real-ip": "<REDACTED>"
          },
  • e

    Erisa | Support Engineer

    05/01/2022, 12:46 AM
    thats my IP address :P but yes thats the same as what im seeing too from mitmproxy
  • v

    Vitali

    05/01/2022, 12:46 AM
    Don't know what's happening, but that x-amz-date header isn't making it into R2
  • v

    Vitali

    05/01/2022, 12:46 AM
    I thought you said they were sending it?
  • i

    itsmatteomanf

    05/01/2022, 12:46 AM
    You missed one at the bottom 🙂
  • v

    Vitali

    05/01/2022, 12:46 AM
    x-amz-date
    isn't there
  • e

    Erisa | Support Engineer

    05/01/2022, 12:46 AM
    oh wait no its not the same as what im seeing my bad
  • v

    Vitali

    05/01/2022, 12:47 AM
    Maybe the mitmproxy strips it. Or maybe it's some middleware on our end.
  • e

    Erisa | Support Engineer

    05/01/2022, 12:47 AM
    mitmproxy gives me
    Copy code
    X-Amz-Algorithm:     AWS4-HMAC-SHA256
    X-Amz-Credential:    redacted/20220501/us-east-1/s3/aws4_request
    X-Amz-Date:          20220501T004441Z
    X-Amz-Expires:       900
    X-Amz-SignedHeaders: content-md5;content-type;host;x-amz-acl;x-amz-meta-mtime
    X-Amz-Signature:     redacted
  • e

    Erisa | Support Engineer

    05/01/2022, 12:47 AM
    its the same symptom without mitmproxy, just tried
  • v

    Vitali

    05/01/2022, 12:47 AM
    X-Amz-Credential
    isn't a thing though
  • v

    Vitali

    05/01/2022, 12:47 AM
    That's part of the
    Authorization
    header
  • v

    Vitali

    05/01/2022, 12:47 AM
    FML. That's presigned
  • e

    Erisa | Support Engineer

    05/01/2022, 12:47 AM
    oh wait wait hang on i get it now
  • e

    Erisa | Support Engineer

    05/01/2022, 12:47 AM
    its sending X-Amz-Date as a query
  • v

    Vitali

    05/01/2022, 12:48 AM
    We don't support presigned yet
1...959697...1050Latest