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

fix: Prevent cookie duplication when calling /apps/:slug/open #425

Merged
merged 2 commits into from
Sep 30, 2022

Conversation

Ldoppea
Copy link
Member

@Ldoppea Ldoppea commented Sep 22, 2022

In some scenario (mainly in production) we observed that cookie was duplicated in the HTTP headers. Also both cookies were separated by a comma instead of a semicolon

This form is not supported by cozy-stack and the result is that the cozy-stack consider the request is not cookie-authenticated

So when calling /apps/:slug/open, a new generated cookie would be returned instead of the provided one as expected in #277

To fix this we want to specify credentials:omit into the fetch options, this would prevent react-native to inject a copy of the same cookie

More info: facebook/react-native#23185 (comment)


TODO:

@Ldoppea Ldoppea force-pushed the fix/prevent_cookie_duplication branch from ed1f6a0 to 110b3a1 Compare September 30, 2022 15:18
`cozy-client` as been upgraded to to `33.2.0` to retrieve ability to
override stack-client's `options.credentials` from
cozy/cozy-client#1250
In some scenario (mainly in production) we observed that cookie was
duplicated in the HTTP headers. Also both cookies were separated by a
comma instead of a semicolon

This form is not supported by cozy-stack and the result is that the
cozy-stack consider the request is not cookie-authenticated

So when calling `/apps/:slug/open`, a new generated cookie would be
returned instead of the provided one as expected in #277

To fix this we want to specify `credentials:omit` into the fetch
options, this would prevent react-native to inject a copy of the same
cookie

More info: facebook/react-native#23185 (comment)
@Ldoppea Ldoppea force-pushed the fix/prevent_cookie_duplication branch from 110b3a1 to f3915c4 Compare September 30, 2022 15:23
@Ldoppea Ldoppea merged commit 1452b81 into master Sep 30, 2022
@Ldoppea Ldoppea deleted the fix/prevent_cookie_duplication branch September 30, 2022 17:06
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

Successfully merging this pull request may close these issues.

2 participants