react-nativeexpohttp-headersauthorizationrequest-headers

IOS ignores the authorization header when sending a HTTP request in Expo - react native


I'am developing a mobile application in react native with the help of Expo,My backend needs to get an authorization header that contains the bearer token, in android all good but when i use my app in iPhone ( Expo Go ) , it ignore the Authorization header or even delete it and i know it's something related t IOS , is there any solution for this ( am using a nestJs back-end and am running it locally )

**Environment info  **
"expo": "~48.0.11"
"react-native": "0.71.7"
"react": "18.2.0",
Real device : Iphone 8+ 
IOS version 16.3

I tried to send bearer token in the authorization header, it worked on android but on IOS did not work. The expecting behavior is to send the header request without ignoring the authorization


Solution

  • This was answered here. I also changed the header to X-Authorization to bypass this.