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

Modifying the headers before callling fetch

Open ndpmurphy opened this issue 7 years ago • 1 comments

I am using a proxy to redirect my traffic before going to api.segment.io. My proxy has some special header requirements, so I want to modify the headers before the fetch call.

I am considering making a local modification which allows a modifyHeaders function to be passed into the analytics-react-native module, and that function could be called after the headers have been constructed and before fetch is called.

Before I do that I was hoping someone could tell me if there is already a way of doing this, or if there is a better design

ndpmurphy avatar Dec 08 '17 10:12 ndpmurphy

Hi @ndpmurphy

Right now this is not implemented. If you want to made the changes and create a pull request, you can take a look here: https://github.com/neiker/analytics-react-native/blob/master/src/index.js#L220

neiker avatar Dec 20 '17 14:12 neiker