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

    kian

    03/01/2023, 10:13 AM
    It's not supposed to, that's expected
  • w

    wlp2s0

    03/01/2023, 10:15 AM
    Copy code
    location / {
            if ($request_method = 'OPTIONS') {
        add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
        add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';                                                                                                  
        add_header 'Access-Control-Allow-Credentials' 'true';
    
        add_header 'Access-Control-Allow-Origin' $http_origin;
        add_header 'Access-Control-Max-Age' 1728000;
        add_header 'Content-Type' 'text/plain; charset=utf-8';
        add_header 'Content-Length' 0;
        return 204;
    }
    This configuration in nginx solved the issue for us on a local setup
  • e

    elithrar

    03/01/2023, 10:15 AM
    Explicitly allow the Origin you need.
    *
    has caveats for authenticated requests and is not the same as specifying exact origins.
  • k

    kian

    03/01/2023, 10:16 AM
    That's not really how CORS is supposed to work - a
    204
    with appropriate headers is returned if your request matches your CORS configuration, and is only returned in response to a request with the right headers rather than always responding to an
    OPTIONS
    request.
  • k

    kian

    03/01/2023, 10:17 AM
    Without having the URL of the bucket, it's hard to test. You can replicate the request w/ curl and see the response body/headers.
  • s

    skaboy007

    03/01/2023, 10:53 AM
    we setting up an expamle
  • u

    ucinteractivesl

    03/01/2023, 12:42 PM
    That means in the configuration of my web app I have to set region:auto?
  • w

    wlp2s0

    03/01/2023, 12:51 PM
    We have a preview of the issue setup https://hls-js.netlify.app/demo/ - here is a hsl player https://vcdn.cf.all1.leap-gaming.com/videotest/res/t/Big_Buck_Bunny_first_23_seconds_1080p.m3u8 this is the link
  • k

    kian

    03/01/2023, 12:57 PM
  • k

    kian

    03/01/2023, 12:57 PM
    Seems fine to me?
  • k

    kian

    03/01/2023, 12:57 PM
  • w

    wlp2s0

    03/01/2023, 1:00 PM
    yeah, try firefox now
  • z

    Zeblote

    03/01/2023, 1:03 PM
    the video works fine for me in firefox
  • w

    wlp2s0

    03/01/2023, 1:06 PM
    I see this while trying to play it
  • z

    Zeblote

    03/01/2023, 1:07 PM
    weird I don't
  • z

    Zeblote

    03/01/2023, 1:08 PM
  • z

    Zeblote

    03/01/2023, 1:09 PM
    oh - it defaults to a different video url, I see
  • z

    Zeblote

    03/01/2023, 1:10 PM
    now it's broken for me too
  • s

    skaboy007

    03/01/2023, 1:10 PM
    its .MP4 not .TS. strange
  • s

    skaboy007

    03/01/2023, 1:13 PM
    I get this
  • w

    wlp2s0

    03/01/2023, 1:14 PM
    It has all the parts and encoding is the same. Max just didn't rename it properly
  • u

    ucinteractivesl

    03/01/2023, 3:01 PM
    Getting this cors error while loading a video that I previoulsy uploaded and sent to bucket
  • u

    ucinteractivesl

    03/01/2023, 3:01 PM
    Any hint?
  • k

    kev-ac

    03/01/2023, 3:02 PM
    You haven't set up a CORS policy for the bucket / file.
  • u

    ucinteractivesl

    03/01/2023, 3:02 PM
    Well I did, but seems that is not working
  • k

    kev-ac

    03/01/2023, 3:03 PM
    Have you tried using a custom domain? I don't think you can use the *.r2.cloudflarestorage.com if you have not presigned the URL.
  • k

    kev-ac

    03/01/2023, 3:04 PM
    See: https://developers.cloudflare.com/r2/learning/cors
  • u

    ucinteractivesl

    03/01/2023, 3:04 PM
  • u

    ucinteractivesl

    03/01/2023, 3:04 PM
    This is my cors plicy
  • k

    kev-ac

    03/01/2023, 3:05 PM
    As you've specified "*" as a allowed origin you could remove the other ones. But this should not matter now
1...921922923...1050Latest