You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today, when following redirects on Android, the headers passed to downloadFile() method are not forwarded on the second request that follows the redirect.
I understand that, by design, most http clients don't forward the headers be default for security reasons. My suggestion is to add a configuration parameter to allow the developer to allow this to happen.
Why it is needed
When dealing with URLs that require an authorisation header this makes the request ending up as Unauthorised.
Feature Request
Today, when following redirects on Android, the headers passed to
downloadFile()
method are not forwarded on the second request that follows the redirect.I understand that, by design, most http clients don't forward the headers be default for security reasons. My suggestion is to add a configuration parameter to allow the developer to allow this to happen.
Why it is needed
When dealing with URLs that require an authorisation header this makes the request ending up as Unauthorised.
Possible implementation
Set the initial request properties on the connection that follows the redirect if a new parameter (e.g.
forwardHeadersOnRedirect
) is true:https://github.com/itinance/react-native-fs/blob/master/android/src/main/java/com/rnfs/Downloader.java#L79
Code sample
The text was updated successfully, but these errors were encountered: