Open lux-shaun opened 1 week ago
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
.
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.