Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom headers are ignored #382

Open
iamalismith opened this issue Jun 25, 2024 · 0 comments
Open

Custom headers are ignored #382

iamalismith opened this issue Jun 25, 2024 · 0 comments

Comments

@iamalismith
Copy link

iamalismith commented Jun 25, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant