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 request headers to react-native-turbo VisitableView #216

Open
lux-shaun opened this issue Sep 27, 2024 · 1 comment
Open

Add request headers to react-native-turbo VisitableView #216

lux-shaun opened this issue Sep 27, 2024 · 1 comment

Comments

@lux-shaun
Copy link

Both turbo-ios and turbo-android support adding requests headers, as do other webviews.
Not being able to do so here is problematic for native authentication in particular, as there doesn't seem to be any way to share session information.

@pfeiffer
Copy link
Contributor

It's not possible to set custom headers for any other requests than the initial cold boot request (in WKWebView which turbo-ios uses), as subsequent Turbo-driven requests in the WebView would have the potential to leak sensitive headers (eg. authentication headers).

For this reason, it's not supported to add custom headers for all requests, as it'd either cause potential leaking of sensitive headers or make using custom headers for eg. authentication impractical as they would only work for the initial cold boot request.

If you need to communicate something (non-sensitive!) to your backend using headers, the applicationNameForUserAgent prop can be used.

The same is true for turbo-ios and turbo-android.

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

2 participants