Closed ray007 closed 4 years ago
What version did you upgrade from?
Nothing here that would indicate a bug in CefSharp, more likely a change in CEF/Chromium.
It worked with CEF/CefSharp 84, and does not work anymore with 85.
You can compare the two releases https://github.com/cefsharp/CefSharp/compare/v84.4.10...v85.3.130
I only remember one change to ResourceHandler, you can easily remove the header for testing purposes.
The fact that it works for GET requests and not POST it's more likely a change in CEF/Chromium and not CefSharp specific.
I'd personally try switching to using the https scheme and registering the schemehandlerfactory with a domain name.
I already did look through history and didn't see anything I would think could cause this, but then I do not know the code well enough to really judge that.
The GET
requests go to a custom protocol scheme, I only use the http
protocol for storing data to cache since otherwise I do not get POST
data in the scheme handler.
I also have a line
settings.CefCommandLineArgs.Add("disable-web-security", "true");
in my code so I do not need CORS anywhere else, maybe there was a change with web-security somewhere? I also added for testing
settings.CefCommandLineArgs.Add("disable-oor-cors", "true");
but that didn't change anything.
I also wouldn't care if the scheme handler did use CORS if it sent the right headers in the response, but settings IsCorsEnabled
and IsStandard
to true
doesn't do that. Am I missing something?
Or is there another way to efficiently get large amount of binary data from the js-app to the C# layer?
Have you tried registering your schemehandlerfactory using https and specifying a domain? You can specify a subdomain of the domain you are sending requests from.
See https://github.com/cefsharp/CefSharp/blob/cefsharp/85/CefSharp.Example/CefExample.cs#L183 for an example.
If you have and that didn't work then I'd suggest moving the conversation over to https://magpcss.org/ceforum/index.php see if ther have been any other reports.
It's very strange. I have changed all my scheme-handlers to http
, with the project data handler using a subdomain of the application code handler.
The GET
requests for existing cache data still work fine (without CORS), the POST
requests to put new data into the cache still fail with a CORS error.
Update: interestingly, adding
settings.CefCommandLineArgs.Add("disable-features", "OutOfBlinkCors");
makes things work again.
Question asked at https://magpcss.org/ceforum/viewtopic.php?f=18&t=17968
Bug Report
What version of the product are you using? Version 85, self-compiled
What architecture x86 or x64? x64
On what operating system? Win10
Are you using
WinForms
,WPF
orOffScreen
? WPFWhat steps will reproduce the problem?
I have updated my application to use CefSharp 85, and suddenly my scheme-handler which takes data from
POST
requests to ahttp:
address to cache it in the file-system fails with CORS errors.Interestingly,
GET
requests to a custom scheme (prjdata:
) still work fine.If it makes a difference, my application shown in the WPF view is also served by a custom-scheme
myapp:
.I know that my scheme-handler gets called and executed without problems, just the reponse to the browser goes missing. The error message in the console is
No errors visible in visual studio. Not sure if it's relevant, but in
debug.log
I find several lines