feat: only follow serverUrlPrefix at redirect to client (#5295) (#5354)

feat: only follow `serverUrlPrefix` at redirect to client (#5295)

fix: use secure websocket (#5297)
This commit is contained in:
Joooye_34
2023-12-20 07:52:57 +00:00
parent 800ea0abf1
commit 80eeb2ddc7
7 changed files with 27 additions and 21 deletions
@@ -21,15 +21,13 @@ export const createAffineCloudBlobStorage = (
? key
: `/api/workspaces/${workspaceId}/blobs/${key}`;
return fetchWithTraceReport(runtimeConfig.serverUrlPrefix + suffix).then(
async res => {
if (!res.ok) {
// status not in the range 200-299
return null;
}
return bufferToBlob(await res.arrayBuffer());
return fetchWithTraceReport(suffix).then(async res => {
if (!res.ok) {
// status not in the range 200-299
return null;
}
);
return bufferToBlob(await res.arrayBuffer());
});
},
set: async (key, value) => {
const {