mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-21 20:16:26 +08:00
feat: only follow serverUrlPrefix at redirect to client (#5295)
This commit is contained in:
@@ -17,8 +17,7 @@ export async function downloadBinaryFromCloud(
|
||||
return cached;
|
||||
}
|
||||
const response = await fetchWithTraceReport(
|
||||
runtimeConfig.serverUrlPrefix +
|
||||
`/api/workspaces/${rootGuid}/docs/${pageGuid}`,
|
||||
`/api/workspaces/${rootGuid}/docs/${pageGuid}`,
|
||||
{
|
||||
priority: 'high',
|
||||
}
|
||||
|
||||
@@ -22,9 +22,7 @@ import useSWRMutation from 'swr/mutation';
|
||||
|
||||
setupGlobal();
|
||||
|
||||
export const fetcher = gqlFetcherFactory(
|
||||
runtimeConfig.serverUrlPrefix + '/graphql'
|
||||
);
|
||||
export const fetcher = gqlFetcherFactory('/graphql');
|
||||
|
||||
/**
|
||||
* A `useSWR` wrapper for sending graphql queries
|
||||
|
||||
@@ -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 undefined;
|
||||
}
|
||||
return bufferToBlob(await res.arrayBuffer());
|
||||
return fetchWithTraceReport(suffix).then(async res => {
|
||||
if (!res.ok) {
|
||||
// status not in the range 200-299
|
||||
return undefined;
|
||||
}
|
||||
);
|
||||
return bufferToBlob(await res.arrayBuffer());
|
||||
});
|
||||
},
|
||||
set: async (key, value) => {
|
||||
const {
|
||||
|
||||
@@ -7,7 +7,7 @@ export function getIoManager(): Manager {
|
||||
if (ioManager) {
|
||||
return ioManager;
|
||||
}
|
||||
ioManager = new Manager(runtimeConfig.serverUrlPrefix + '/', {
|
||||
ioManager = new Manager('/', {
|
||||
autoConnect: false,
|
||||
transports: ['websocket'],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user