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
feat: add HTTP headers through reachabilityHeaders param to NetInfoConfiguration #673
feat: add HTTP headers through reachabilityHeaders param to NetInfoConfiguration #673
Conversation
@matt-oakes @mikehardy any idea when you'll have time to look into this PR? |
@matt-oakes @mikehardy any updates guys? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay, incredibly busy unfortunately.
Thank you for your patience
This looks fine though, thank you for the contribution!
# [9.5.0](v9.4.2...v9.5.0) (2023-11-01) ### Features * add optional reachabilityHeaders param to NetInfoConfiguration ([#673](#673)) ([0cbf067](0cbf067))
🎉 This PR is included in version 9.5.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@@ -115,6 +115,7 @@ export type NetInfoSubscription = () => void; | |||
export interface NetInfoConfiguration { | |||
reachabilityUrl: string; | |||
reachabilityMethod?: NetInfoMethodType; | |||
reachabilityHeaders?: HeadersInit; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @webraptor 👋 - this HeadersInit
appears undefined, as noted in #693 - what should it be? Seem like it should be whatever valid internet headers are, perhaps { [index: string]: string; }
or similar? What do you think?
Overview
We've been using react-native-netinfo for quite some time now. We recently needed a change where we can pass along custom headers to the reachability request. This PR adds a new
reachabilityHeaders
prop toNetInfoConfiguration
so that HTTP headers can be set on the request.Test Plan
Ran the entire test suite & validation the project has, ensured code style matches. We also tested the integration within our project to validate the functionality against our backend which requires custom headers be present in the request.