react-native-offline icon indicating copy to clipboard operation
react-native-offline copied to clipboard

Custom headers are ignored

Open iamalismith opened this issue 1 year ago • 0 comments

Current Behavior

Adding a pingServerUrl and customHeaders object does not result in the custom headers being sent with the ping request.

<NetworkProvider
    pingServerUrl={`https://pingurl.com/ping`}
    customHeaders={{ 'any-custom-header': 'xyz' }}
  >

Expected Behavior

Adding custom headers attaches those headers to the requests that check the internetConnectivity

How to reproduce

add customHeaders prop and a pingServerUrl

<NetworkProvider
    pingServerUrl={`https://pingurl.com/ping`}
    customHeaders={{ 'any-custom-header': 'xyz' }}
  >

Observe that pings do not contain the headers as expected.

Your Environment

software version
react-native-offline 6.0.2
react-native 0.71
node 16
npm or yarn yarn

iamalismith avatar Jun 25 '24 09:06 iamalismith