1 parent feea9d0 commit ec44f94Copy full SHA for ec44f94
1 file changed
src/runtime/minimal-client.ts
@@ -47,14 +47,17 @@ export function createClient (config: ClientConfig) {
47
const useCdn = perspective !== 'previewDrafts' && config.useCdn
48
49
const fetchOptions: RequestInit = {
50
- credentials: withCredentials ? 'include' : 'omit',
51
headers: {
52
...(token ? { Authorization: `Bearer ${token}` } : {}),
53
Accept: 'application/json',
54
...(process.server ? { 'accept-encoding': 'gzip, deflate' } : {}),
55
},
56
}
57
+ if (import.meta.client) {
58
+ fetchOptions.credentials = withCredentials ? 'include' : 'omit'
59
+ }
60
+
61
return {
62
clone: () =>
63
createClient({
0 commit comments