React-native-debugger: Refused to set unsafe header in console log

Created on 29 Jun 2017  路  5Comments  路  Source: jhen0409/react-native-debugger

there is this error in my console log and I don't know what causes this

image

and whenever I do console.log this error is happened again
image

React Native Debugger version: [0.7.0]
React Native version: [^0.44.0]
Platform: [Android]
Is real device of platform: [Yes]
Operating System: [Linux]

question

Most helpful comment

It looks like you're enabled Network Inspect, so it will use XHR from WebWorker, it's different from the XHR implementation of RN, so we have to pay attention to some limitations.

You need to track what requests use these headers.

All 5 comments

It looks like you're enabled Network Inspect, so it will use XHR from WebWorker, it's different from the XHR implementation of RN, so we have to pay attention to some limitations.

You need to track what requests use these headers.

yup, seems it's from my project configuration
upgrade it to react native 0.45/reinit the project then the error is gone

I need to set User-Agent and Cookie, which are unsafe.
Tried it on a fresh React Native 0.45.1 project, got "Refused to set unsafe header" error anyway.

According to the XMLHttpRequest standard (see step 5 here) there are "forbidden" headers which cannot be set. There's no way around it (other than patching the browser).

We can follow #102 for implement our Network Inspect feature.

118 will fix the problem of forbidden headers, I'll release it later.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MailosT picture MailosT  路  4Comments

AndrejGajdos picture AndrejGajdos  路  4Comments

arrygoo picture arrygoo  路  5Comments

Visylvius picture Visylvius  路  3Comments

idrakimuhamad picture idrakimuhamad  路  3Comments