Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion packages/cubejs-backend-cloud/src/cloud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export class CubeCloudClient {
restOptions.headers = restOptions.headers || {};
// Add authorization to headers
(restOptions.headers as any).authorization = authorization.auth;
(restOptions.headers as any)['Content-type'] = 'application/json';

const response = await fetch(
`${authorization.url}/${url(authorization.deploymentId || '')}`,
Expand Down Expand Up @@ -141,6 +142,9 @@ export class CubeCloudClient {
url: (deploymentId: string) => `build/deploy/${deploymentId}/finish-upload${this.extendRequestByLivePreview()}`,
method: 'POST',
body: JSON.stringify({ transaction, files }),
headers: {
'Content-type': 'application/json'
},
auth,
});
}
Expand All @@ -149,7 +153,10 @@ export class CubeCloudClient {
return this.request({
url: (deploymentId) => `build/deploy/${deploymentId}/set-env`,
method: 'POST',
body: JSON.stringify({ envVariables }),
body: JSON.stringify({ envVariables: JSON.stringify(envVariables) }),
headers: {
'Content-type': 'application/json'
},
auth
});
}
Expand All @@ -172,6 +179,9 @@ export class CubeCloudClient {
url: (deploymentId) => `devmode/${deploymentId}/token`,
method: 'POST',
body: JSON.stringify(payload),
headers: {
'Content-type': 'application/json'
},
auth
});
}
Expand Down
6 changes: 5 additions & 1 deletion packages/cubejs-cli/src/command/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,11 @@ const deploy = async ({ directory, auth, uploadEnv, token }: any) => {
url: (deploymentId) => `build/deploy/${deploymentId}/set-env`,
method: 'POST',
body: JSON.stringify({
envVariables,
envVariables: JSON.stringify(envVariables),
}),
headers: {
'Content-type': 'application/json'
},
auth
});
}
Expand Down Expand Up @@ -115,6 +118,7 @@ const deploy = async ({ directory, auth, uploadEnv, token }: any) => {
transaction,
files: fileHashesPosix
}),
headers: { 'Content-type': 'application/json' },
auth
});
} finally {
Expand Down
Loading