-
Notifications
You must be signed in to change notification settings - Fork 330
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
feat(clerk-expo): Remove headers causing CORS errors #3326
Conversation
🦋 Changeset detectedLatest commit: 9e6b63f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
// Send some non-identifying headers that are useful for logging | ||
(requestInit.headers as Headers).set('x-expo-execution-environment', Constants.executionEnvironment); | ||
(requestInit.headers as Headers).set( | ||
'x-expo-native-application-version', | ||
Application.nativeApplicationVersion || 'NULL', | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thiskevinwang If having this kind of information was useful, and don't wanna completely removed it, couldn't we just do this ?
if(!isValidBrowser()) {
// Send some non-identifying headers that are useful for logging
(requestInit.headers as Headers).set('x-expo-execution-environment', Constants.executionEnvironment);
(requestInit.headers as Headers).set(
'x-expo-native-application-version',
Application.nativeApplicationVersion || 'NULL',
);
}
of use import { Platform } from 'react-native';
if (Platform.OS !== 'web') {
// Send some non-identifying headers that are useful for logging
(requestInit.headers as Headers).set('x-expo-execution-environment', Constants.executionEnvironment);
(requestInit.headers as Headers).set(
'x-expo-native-application-version',
Application.nativeApplicationVersion || 'NULL',
);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@panteliselef Oh, smart thinking! But also...
If having this kind of information was useful
...Turns out, it was not particularly useful so I'd say we just remove this!
75c227f
to
e392c80
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
.changeset/sweet-beds-pump.md
Outdated
Remove headers that were added in #2528 | ||
|
||
Remove `expo-application` & `expo-constants` peer deps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thiskevinwang Maybe we could make this a little bit easier to read, as it'll be included in the changelog which is facing the developers using our product. For example, let's mention what are the headers this change removes. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in 05e82b4
packages/expo/package.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thiskevinwang You should also remove those dependencies from the devDependencies
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 05e82b4
Description
This removes two headers, added in #2528, that are resulting in CORS errors being returned from the Clerk Frontend API.
Related:
Checklist
npm test
runs as expected.npm run build
runs as expected.Type of change