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

    Sid | R2

    02/20/2023, 3:52 PM
    Someone yesterday was saying the same thing. CORS config is eventually consistent but it shouldn't take too long
  • h

    HardAtWork

    02/20/2023, 3:54 PM
    It's been about a day for me: https://pub-0177eb9df0874e6e892a9e84263b9075.r2.dev/sprites.json. Just to make sure though, it should send
    ACAO
    even if it isn't an
    OPTIONS
    request, right?
  • s

    Sid | R2

    02/20/2023, 3:54 PM
    Try adding a
    -vv
    argument to see what it's doing?
  • d

    Dani Foldi

    02/20/2023, 3:55 PM
    Same here, I've added an origin yesterday and cors headers are still not present on the actual response
  • h

    HardAtWork

    02/20/2023, 3:55 PM
    Copy code
    2023/02/20 16:55:05 DEBUG : rclone: Version "v1.53.3-DEV" starting with parameters ["rclone" "copy" "planet.pmtiles" "r2:/protomap" "-P" "--s3-upload-concurrency=3" "-vv"]
    2023/02/20 16:55:05 DEBUG : Creating backend with remote "planet.pmtiles"
    2023/02/20 16:55:05 DEBUG : Using config file from "/home/alastair/.config/rclone/rclone.conf"
    2023/02/20 16:55:05 DEBUG : fs cache: adding new entry for parent of "planet.pmtiles", "/mnt"
    2023/02/20 16:55:05 DEBUG : Creating backend with remote "r2:/protomap"
    2023/02/20 16:55:05 DEBUG : fs cache: renaming cache item "r2:/protomap" to be canonical "r2:protomap"
    2023-02-20 16:55:05 DEBUG : planet.pmtiles: Need to transfer - File not found at Destination
    Transferred:             0 / 54.779 GBytes, 0%, 0 Bytes/s, ETA -
    Transferred:            0 / 1, 0%
    Elapsed time:        24.0s
    Transferring:
     *                                planet.pmtiles:  0% /54.779G, 0/s, -
    s
    • 2
    • 211
  • j

    johtso

    02/20/2023, 3:57 PM
    I tested the url here and it seems to be fine https://cors-test.codehappy.dev/?url=https://data.infinitenovelty.com/db.4.sqlite&origin=https://infinitenovelty.com&method=get
    Copy code
    accept-ranges: bytes
    access-control-allow-origin: https://infinitenovelty.com
    cf-cache-status: DYNAMIC
    cf-ray: 79c86f81f22c71c6-LHR
    connection: keep-alive
    content-length: 732532736
    content-type: application/octet-stream
    date: Mon, 20 Feb 2023 15:57:01 GMT
    etag: "bca688cff8901d77164f486ca2cc0cd5"
    last-modified: Mon, 20 Feb 2023 15:31:10 GMT
    server: cloudflare
    vary: Origin, Accept-Encoding
  • j

    johtso

    02/20/2023, 3:58 PM
    but when actually trying to load the file on my site it gives the CORS error.. https://infinitenovelty.com
  • j

    johtso

    02/20/2023, 3:58 PM
  • s

    Sid | R2

    02/20/2023, 4:00 PM
    It should, yep
  • s

    Sid | R2

    02/20/2023, 4:02 PM
    Yeah on that CORS testing site I see a warning, so this does look like an issue
  • j

    johtso

    02/20/2023, 4:03 PM
    isn't that just saying that I have an explicitly allowed domain?
  • j

    johtso

    02/20/2023, 4:03 PM
    which is fine, I have one domain where the resource will be used
  • s

    Sid | R2

    02/20/2023, 4:05 PM
    Yeah NVM I'm an idiot, I thought this meant that this header was missing (when I should have read the line right above the code block)
  • j

    johtso

    02/20/2023, 4:07 PM
    Ah, figured it out, I needed to allow HEAD!
  • s

    Sid | R2

    02/20/2023, 4:10 PM
    For others who were seeing similar CORS issues, I'm guessing y'alls config is correct, right? 😛
  • s

    Sid | R2

    02/20/2023, 4:10 PM
    This one seems to be working fine for me as well now!
  • j

    johtso

    02/20/2023, 4:23 PM
    the problem is, devtools doesn't tell you what kind of request is being made if there is a CORS error
  • s

    Sid | R2

    02/20/2023, 4:23 PM
    The Network tab should, no?
  • j

    johtso

    02/20/2023, 4:24 PM
  • k

    kian

    02/20/2023, 4:25 PM
  • k

    kian

    02/20/2023, 4:25 PM
    One of the queries that Synology makes results in a
    NextMarker
    loop - forever
    s
    i
    j
    • 4
    • 50
  • h

    HardAtWork

    02/20/2023, 4:26 PM
    Here's what I get for headers, live, with cache disabled locally: ``` HTTP/1.1 200 OK Date: Mon, 20 Feb 2023 16:25:18 GMT Content-Type: application/json Transfer-Encoding: chunked Connection: keep-alive ETag: W/"1590706038a3703c37b0c771e68725b1" Last-Modified: Mon, 20 Feb 2023 13:14:46 GMT Vary: Accept-Encoding Server: cloudflare CF-RAY: 79c898efea12be4c-CPH Content-Encoding: gzip ```Is it maybe that it is cached without the CORS headers?
  • s

    Sid | R2

    02/20/2023, 4:28 PM
    So CORS rules aren't cached, they're distributed globally like all other CF config, and so we don't promise strong consistency there
  • h

    HardAtWork

    02/20/2023, 4:29 PM
    No, I meant that it was cached on the Response via the CF Cache. But now I don't remember if R2 public domains even have cache...
  • s

    Sid | R2

    02/20/2023, 4:30 PM
    They don't, out of the box. That's one of the reasons why we encourage you to use a custom domain, so you can configure whatever makes sense to your app
  • g

    gaurav_thakur

    02/20/2023, 4:32 PM
    Anyone with any insight on this would be greatly appreciated
  • h

    HardAtWork

    02/20/2023, 4:33 PM
    #1: Not at the moment #2: Caching is free on Cloudflare. The max size for a cached object is determined by the plan that the custom domain has.
  • g

    gaurav_thakur

    02/20/2023, 4:34 PM
    thanks
  • s

    Sid | R2

    02/20/2023, 4:34 PM
    Also see https://developers.cloudflare.com/workers/platform/limits/#cache-api
  • h

    HardAtWork

    02/20/2023, 4:34 PM
    Happy to help!
1...889890891...1050Latest