Skip to content

Commit e6e3046

Browse files
Return-1cpojer
authored andcommitted
Add section : Known Issues with fetch and [..] (#769)
* Add section : Known Issues with fetch and [..] Cookie based authentication is currently wobbly. Had it not been for the problematic redirect scenario using fetch workarounds could be found (e.g clearing cookies before every single request and manually adding them to the headers). However, because of the 302 issue there is a scenario where using cookies can result in halt of development. The rest of the issues are merely added here so that people that can follow workarounds ( please take a look as unintended consequences might occur ) * Minor text changes and remove the last paragraph.
1 parent 8a7277e commit e6e3046

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

docs/network.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,12 @@ ws.onclose = (e) => {
180180
};
181181
```
182182

183-
## High Five!
183+
## Known Issues with `fetch` and cookie based authentication
184184

185-
If you've gotten here by reading linearly through the tutorial, then you are a pretty impressive human being. Congratulations. Next, you might want to check out [all the cool stuff the community does with React Native](more-resources.md).
185+
The following options are currently not working with `fetch`
186+
- `redirect:manual`
187+
- `credentials:omit`
188+
189+
* Having same name headers on Android will result in only the latest one being present. A temporary solution can be found here: https://github.com/facebook/react-native/issues/18837#issuecomment-398779994.
190+
* Cookie based authentication is currently unstable. You can view some of the issues raised here: https://github.com/facebook/react-native/issues/23185
191+
* As a minimum on iOS, when redirected through a `302`, if a `Set-Cookie` header is present, the cookie is not set properly. Since the redirect cannot be handled manually this might cause a scenario where infinite requests occur if the redirect is the result of an expired session.

0 commit comments

Comments
 (0)