CORB blocking fetch() in whilelisted origin
Posted: Thu Aug 22, 2019 10:05 pm
Hi,
I'm using Javascript loaded on a custom scheme to fetch JSON from a server, which doesn't return CORS headers.
Previously it was working with appropriate CefAddCrossOriginWhitelist calls, e.g. CefAddCrossOriginWhitelist("customscheme://customhost", "https", "", true);
However now I get CORB blocked warnings (I'm using CEF on Windows with cef_binary_75.1.14+gc81164e+chromium-75.0.3770.100)
For reference my Javascript looks like:
const data = new URLSearchParams();
data.append('exampleKey', 'exampleValue');
fetch('https://example.com/some-url', { method: 'post', body: data }).then((response) => {
if (response.ok) {
return response.json();
}
});
The error I'm getting in the dev tools console is the following:
Cross-Origin Read Blocking (CORB) blocked cross-origin response https://example.com/some-url with MIME type application/json. See https://www.chromestatus.com/feature/5629709824032768 for more details
What can I change to allow this response through? Currently it is being changed to an empty string (as described in the CORB document)
I'm using Javascript loaded on a custom scheme to fetch JSON from a server, which doesn't return CORS headers.
Previously it was working with appropriate CefAddCrossOriginWhitelist calls, e.g. CefAddCrossOriginWhitelist("customscheme://customhost", "https", "", true);
However now I get CORB blocked warnings (I'm using CEF on Windows with cef_binary_75.1.14+gc81164e+chromium-75.0.3770.100)
For reference my Javascript looks like:
const data = new URLSearchParams();
data.append('exampleKey', 'exampleValue');
fetch('https://example.com/some-url', { method: 'post', body: data }).then((response) => {
if (response.ok) {
return response.json();
}
});
The error I'm getting in the dev tools console is the following:
Cross-Origin Read Blocking (CORB) blocked cross-origin response https://example.com/some-url with MIME type application/json. See https://www.chromestatus.com/feature/5629709824032768 for more details
What can I change to allow this response through? Currently it is being changed to an empty string (as described in the CORB document)