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

    Vitali

    04/29/2022, 5:33 PM
    As like a default value unconditionally? Is that what S3 does?
  • v

    Vitali

    04/29/2022, 5:37 PM
    @Erisa | Support Engineer / @Jaex the sigv4 thing should be fixed. Can you confirm that stock sharex now works?
  • e

    Erisa | Support Engineer

    04/29/2022, 5:37 PM
    tada

    https://r2-test.erisa.workers.dev/Discord_ymAP8uWin1.png▾

  • e

    Erisa | Support Engineer

    04/29/2022, 5:37 PM
    works a treat!
  • e

    Erisa | Support Engineer

    04/29/2022, 5:42 PM
    For reference to others, for ShareX native S3 support I have these settings:

    https://cdn.erisa.uk/bLXT1wEKT4.png▾

  • k

    kavinplays

    04/29/2022, 5:44 PM
    if someone uses the s3 api, does it go through a worker and count as a worker request?
  • e

    Erisa | Support Engineer

    04/29/2022, 5:44 PM
    no
  • k

    kavinplays

    04/29/2022, 5:44 PM
    noice
  • e

    Erisa | Support Engineer

    04/29/2022, 5:45 PM
    one caveat though - you cant currently read files back from the S3 api without auth, so you need a Worker to serve the files publicly
  • k

    kavinplays

    04/29/2022, 5:45 PM
    assumably wouldn't be the same by the time ga happens
  • e

    Erisa | Support Engineer

    04/29/2022, 5:45 PM
    unsure, would have to ask one of the team for that
  • s

    sean

    04/29/2022, 5:46 PM
    not familiar with S3 API, but sending a PUT request to my r2 endpoint creates a bucket for me, wondering if it's working as intended?
  • i

    Isaac McFadyen | YYZ01

    04/29/2022, 5:47 PM
    I believe they said not by open beta but by GA.
  • e

    Erisa | Support Engineer

    04/29/2022, 5:48 PM
    You're sending a PUT to /testbucket which would tell it to create a bucket, so I don't see why that wouldnt be normal
  • e

    Erisa | Support Engineer

    04/29/2022, 5:49 PM
    To upload a file you'd do /testbucket/filename.etc
  • e

    Erisa | Support Engineer

    04/29/2022, 5:49 PM
    You definitely can create buckets by PUTing them in S3
  • j

    john.spurlock

    04/29/2022, 5:50 PM
    s3 launched before cors or native-app-like-webapps were things
  • i

    Isaac McFadyen | YYZ01

    04/29/2022, 5:50 PM
    On S3 you have to opt-in to CORS via the CORS policy on the bucket.
  • i

    Isaac McFadyen | YYZ01

    04/29/2022, 5:51 PM
  • l

    lmtr0

    04/29/2022, 5:51 PM
    Ok, It's not working.... Code is public https://github.com/lmtr0/r2-test can someone help me?
  • v

    Vitali

    04/29/2022, 5:51 PM
    I'm not super familiar with CORS. So
    Access-Control-Allow-Headers: *
    fails open or closed?
  • i

    Isaac McFadyen | YYZ01

    04/29/2022, 5:52 PM
    Access-Control-Allow-Headers: *
    says that a fetch request from any site can access stuff.
  • l

    lmtr0

    04/29/2022, 5:52 PM
    btw does the cloudflare api allow
    <bucket>.<account>.cloudflare.....
    ? if not, then I found the problem....
  • s

    sean

    04/29/2022, 5:52 PM
    oh nice, not familiar with S3 api. was wondering why i was uploading a keyless object to s3 using that method
  • i

    Isaac McFadyen | YYZ01

    04/29/2022, 5:52 PM
    If you try to send a request and that's not present on the OPTIONS response (preflight, it's called) the browser refuses to send further requests.
  • i

    Isaac McFadyen | YYZ01

    04/29/2022, 5:53 PM
    So it goes: - Browser sends OPTIONS (preflight) - Server returns
    Access-Control-Allow-Origin: *
    if it allows any site to be able to do requests - Browser sends actual request (GET/POST/PUT/etc) - Server returns
    Access-Control-Allow-Origin: *
    to indicate that the browser is allowed to read the response.
  • i

    Isaac McFadyen | YYZ01

    04/29/2022, 5:53 PM
    * is most permissive, if you know who is going to be calling the site you can specify a domain like
    example.com
    which means that only requests from the
    example.com
    Javascript are allowed.
  • j

    john.spurlock

    04/29/2022, 5:55 PM
    my suggestion would be to enable fetch requests from any domain for every s3 api call except GET/HEAD object (those should be settable by the user for each object)
  • i

    Isaac McFadyen | YYZ01

    04/29/2022, 5:55 PM
    Should be origin there, not headers, by the way. EDIT: Actually, it should be both,
    Access-Control-Allow-Headers: *
    to allow amz- headers and
    Access-Control-Allow-Origin: *
    to allow all origins.
  • i

    Isaac McFadyen | YYZ01

    04/29/2022, 5:55 PM
    Access-Control-Allow-Origin: *
1...767778...1050Latest