oembed-extractor
oembed-extractor copied to clipboard
Refused to set unsafe header "user-agent"
Hi
I'm getting the following console error when using this lib in Chrome.
Any ideas how to prevent this?
Thanks.
@markhats thank you, it seems relate to Chrome secure policy.
JUST REMOVE THE USER AGENT HEADER..
@ndaidong I have the same problem.
I've tried doing the following before calling extract(url)
:
setRequestOptions({
headers: {
accept: 'application/json; charset=utf-8',
},
});
and
setRequestOptions({
headers: {
'user-agent': '',
accept: 'application/json; charset=utf-8',
},
});
and
setRequestOptions({
headers: {
'user-agent': undefined,
accept: 'application/json; charset=utf-8',
},
});
and
setRequestOptions({
headers: {
'user-agent': null,
accept: 'application/json; charset=utf-8',
},
});
None of these helped, I'm still getting Refused to set unsafe header "user-agent"
on the console.
I've also tried passing these parameters to extract()
directly, but that also didn't help.
Can you help me out on how to avoid this error?
@dJani97 thank you for raising issue. If you are using TypeScript , there is exactly some mistakes in type declaration. I will release v3.1.3 to fix. Please test it again after that.