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.
@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.
@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
| Remove headers that were added in #2528 | ||
|
|
||
| Remove `expo-application` & `expo-constants` peer deps |
There was a problem hiding this comment.
@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.
@thiskevinwang You should also remove those dependencies from the devDependencies.
Description
This removes two headers, added in #2528, that are resulting in CORS errors being returned from the Clerk Frontend API.
Related:
Checklist
npm testruns as expected.npm run buildruns as expected.Type of change