Custom scheme for file URLS ignore is_local option
Posted: Mon May 07, 2018 9:23 am
Hello there!
I have a question that's really annoying. I'm using Unreal Engine 4 embedded CEF, my use case involves the use of POST requests to send files to some destination.
Googling around I found out that I needed to register a custom scheme for "file" and enable is_local, and I also had to set "disable-web-security" and "allow-runing-insecure-content" to cef. I did it and it worked well. It was on version 3.2693 on windows x64.
When Epic games updated CEF to 3.3071, AddCustomScheme changed signature adding three more parameters. One of that parameters specifically allowed for CORS. The problem is that in this version, even with cors set to true, won't let me access file:/// URLS (Denied unauthorized request for file:///path.blabla). Here is how I register the scheme
And here is where I add my custom parameters
Since this happened after cef version change, could be that I need something different to enable cors and local access to cef?
I tried setting "enable-local-file-accesses" but with no luck. I guess I'm missing something, but I don't know what.
Being that a specifically embedded version of cef, it's not possible for me to update or downgrade it without taking care of unreal source code too, and this is out of the question.
Thanks in advance for your support.
I have a question that's really annoying. I'm using Unreal Engine 4 embedded CEF, my use case involves the use of POST requests to send files to some destination.
Googling around I found out that I needed to register a custom scheme for "file" and enable is_local, and I also had to set "disable-web-security" and "allow-runing-insecure-content" to cef. I did it and it worked well. It was on version 3.2693 on windows x64.
When Epic games updated CEF to 3.3071, AddCustomScheme changed signature adding three more parameters. One of that parameters specifically allowed for CORS. The problem is that in this version, even with cors set to true, won't let me access file:/// URLS (Denied unauthorized request for file:///path.blabla). Here is how I register the scheme
- Code: Select all
void FCEFBrowserApp::OnRegisterCustomSchemes(CefRawPtr<CefSchemeRegistrar> registrar) {
registrar->AddCustomScheme("file", true, true, false, false, true, false);
}
And here is where I add my custom parameters
- Code: Select all
void FCEFBrowserApp::OnBeforeCommandLineProcessing(const CefString& ProcessType, CefRefPtr< CefCommandLine > CommandLine)
{
CommandLine->AppendSwitch("disable-gpu");
CommandLine->AppendSwitch("disable-gpu-compositing");
CommandLine->AppendSwitch("allow-running-insecure-content");
CommandLine->AppendSwitch("enable-media-stream");
CommandLine->AppendSwitch("disable-web-security");
CommandLine->AppendSwitch("enable-local-file-accesses");
#if !PLATFORM_MAC
CommandLine->AppendSwitch("enable-begin-frame-scheduling");
#endif
}
Since this happened after cef version change, could be that I need something different to enable cors and local access to cef?
I tried setting "enable-local-file-accesses" but with no luck. I guess I'm missing something, but I don't know what.
Being that a specifically embedded version of cef, it's not possible for me to update or downgrade it without taking care of unreal source code too, and this is out of the question.
Thanks in advance for your support.