@stoker-platform/cli 0.5.134 → 0.5.135
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/package.json +1 -1
- package/lib/src/project/customDomain.js +14 -16
- package/package.json +1 -1
package/lib/package.json
CHANGED
|
@@ -119,26 +119,24 @@ export const customDomain = async (options) => {
|
|
|
119
119
|
"describe",
|
|
120
120
|
`gs://${projectId}`,
|
|
121
121
|
`--project=${projectId}`,
|
|
122
|
+
"--raw",
|
|
122
123
|
"--format=json",
|
|
123
124
|
]);
|
|
124
125
|
const corsConfigJson = JSON.parse(corsConfigString);
|
|
125
126
|
const existingCors = corsConfigJson.cors || [];
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
maxAgeSeconds: 3600,
|
|
140
|
-
},
|
|
141
|
-
];
|
|
127
|
+
const customDomainOrigin = `https://${options.domain}`;
|
|
128
|
+
const corsToWrite = existingCors.length > 0
|
|
129
|
+
? existingCors.map((corsEntry) => ({
|
|
130
|
+
...corsEntry,
|
|
131
|
+
origin: Array.from(new Set([...(corsEntry.origin || []), customDomainOrigin])),
|
|
132
|
+
}))
|
|
133
|
+
: [
|
|
134
|
+
{
|
|
135
|
+
origin: [customDomainOrigin],
|
|
136
|
+
method: ["GET"],
|
|
137
|
+
maxAgeSeconds: 3600,
|
|
138
|
+
},
|
|
139
|
+
];
|
|
142
140
|
await writeFile("cors.json", JSON.stringify(corsToWrite));
|
|
143
141
|
await runChildProcess("gcloud", [
|
|
144
142
|
"storage",
|