I'm using Django with Rest framework and React to make a call to this API url.
I already enabled CORS, however, the axios request is still blocked by CORB.
Also tried to temporarily disable it, by starting Chrome with the following command line flag:
--disable features=CrossSiteDocumentBlockingAlways,CrossSiteDocumentBlockingIfIsolating
Here is the code:
componentDidMount() {
const articleID = this.props.match.params.articleID;
axios.get(`http://127.0.0.1:8000/api/${articleID}`, {
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET',
'Content-Type': 'application/json',
'X-Content-Type-Options': 'nosniff'
}
}).then(res => {
this.setState({
article: res.data
});
console.log(`http://127.0.0.1:8000/api/${articleID}`);
//console.log(res.data);
});
}
This is the error
WARNING: Cross-Origin Read Blocking (CORB) blocked cross-origin response http://127.0.0.1:8000/api/1 with MIME type application/json.