GitHub's "Download Raw File" doesn't work with CORS error

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

GitHub's "Download Raw File" doesn't work with CORS error

Postby TakashiHSD » Thu Mar 28, 2024 9:08 pm

Hi,

CEF can't download raw files from GitHub on CEF v120 or later.
It works fine on CEF v119.

How to reproduce:

1. Download cefclient.exe from https://cef-builds.spotifycdn.com/index ... ndows32aaa
2. Open https://github.com/chromiumembedded/cef ... /README.md
3. Click a "Download Raw File" button

Then, downloading doesn't start.

Reproduction has been confirmed only on Windows.
I have not confirmed whether this occurs in other platforms.

By tracing, the error below was logged.

```
{
"args": {
"message": {
"content": "Access to fetch at 'https://raw.githubusercontent.com/chromiumembedded/cef/master/README.md' (redirected from 'https://github.com/chromiumembedded/cef/raw/master/README.md') from origin 'https://github.com' has been blocked by CORS policy: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'.",
"url": "https://github.com/chromiumembedded/cef/blob/master/README.md"
},
"source": "JS"
},
"cat": "blink.console",
"name": "ConsoleMessage::Error",
"ph": "I",
"pid": 17392,
"s": "t",
"tid": 17084,
"ts": 327178865475,
"tts": 6476426
},
```

It seems that a cross domain access between "raw.githubusercontent.com" and "github.com" is rejected by the CORS policy.

The same error occurs in my application embedding CEF.

Does anyone know how to avoid this error without disabling CORS(`CefBrowserSettings.web_security_disabled = true`)?

Thanks,
Last edited by TakashiHSD on Thu Mar 28, 2024 11:45 pm, edited 1 time in total.
TakashiHSD
Newbie
 
Posts: 7
Joined: Mon Apr 17, 2023 2:19 am

Re: Downloaing raw file from Github doesn't work with CORS e

Postby magreenblatt » Thu Mar 28, 2024 9:58 pm

magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Downloaing raw file from Github doesn't work with CORS e

Postby TakashiHSD » Thu Mar 28, 2024 11:44 pm

Hi, magreenblatt, thank you for your reply!

> Please add a bug at https://github.com/chromiumembedded/cef/issues

I have added a bug issue.

https://github.com/chromiumembedded/cef/issues/3675

Thanks,
TakashiHSD
Newbie
 
Posts: 7
Joined: Mon Apr 17, 2023 2:19 am


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 142 guests