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

Add custom HTTP headers configuration #276

Closed
Stonepaw opened this issue Oct 19, 2018 · 10 comments
Closed

Add custom HTTP headers configuration #276

Stonepaw opened this issue Oct 19, 2018 · 10 comments
Assignees
Labels
type:enhancement New features or improvements to existing features.
Milestone

Comments

@Stonepaw
Copy link

I would like to add a custom header to outgoing events but I don't see a way to add that to the emitter. Is this supported or could be supported?

@alexanderdean
Copy link
Member

What would be the purpose of this downstream in Snowplow?

@Stonepaw
Copy link
Author

We would be passing in an authentication header to ensure only authenticated clients can send events.

@alexanderdean
Copy link
Member

It's a neat idea - we are working on an "authenticated events" RFC but no specific plans around how we would implement this at this time (whether it would be headers or an update to the Snowplow Tracker Protocol).

@Stonepaw
Copy link
Author

Will it be possible any time soon to add custom headers?

I cannot add it in my client because:

  • The okHttpClient is private and I cannot add an interceptor to add headers to every request
  • I cannot subclass Emitter in order to manipulate the list returned from buildRequests to add a header to any particular request.

@Stonepaw
Copy link
Author

#269 Merging this PR will allow adding a header interceptor to the OkHttpClient which will solve this issue.

@AlexBenny
Copy link
Contributor

Closing as it has been closed in the PR #269

@shalinibnair
Copy link

@Stonepaw , is it possible to add the custom header now. We are using react native tracker and need to send custom headers

@AlexBenny
Copy link
Contributor

Hi @shalinibnair , at the moment that feature is not available directly in our react-native tracker. The custom headers can be added in the native trackers (which are wrapped by React Native tracker) but there isn't any specific configuration that lets the developer to set it in the React Native tracker. We (or you, if you prefer) can open an enhancement issue in the react native tracker repository. It's not in our roadmap for this quarter but we may consider that feature for next release.

@AlexBenny
Copy link
Contributor

@shalinibnair, I've just created the issue in the react native repository. Feel free to continue the conversation there or add details for further improvements.
Thanks for raising this request.

@matus-tomlein
Copy link
Contributor

matus-tomlein commented Jun 15, 2023

Reopening this issue because it is a requested feature to add the ability to set custom headers and the approach to set a custom HTTP client is a bit awkward also because it changes the cookie jar. It would be better to have a an option in the NetworkConfiguration for it just like in the iOS tracker.

Also it's requested in this Flutter tracker issue: snowplow/snowplow-flutter-tracker#34

@matus-tomlein matus-tomlein reopened this Jun 15, 2023
@matus-tomlein matus-tomlein self-assigned this Jun 15, 2023
@matus-tomlein matus-tomlein added this to the 5.3.0 milestone Jun 15, 2023
@matus-tomlein matus-tomlein added the type:enhancement New features or improvements to existing features. label Jun 15, 2023
@matus-tomlein matus-tomlein changed the title Custom headers Add custom HTTP headers configuration Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement New features or improvements to existing features.
Projects
None yet
Development

No branches or pull requests

5 participants