mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-20 19:46:32 +08:00
feat: only follow serverUrlPrefix at redirect to client (#5295)
This commit is contained in:
@@ -79,8 +79,7 @@ const snapshotFetcher = async (
|
||||
return null;
|
||||
}
|
||||
const res = await fetchWithTraceReport(
|
||||
runtimeConfig.serverUrlPrefix +
|
||||
`/api/workspaces/${workspaceId}/docs/${pageDocId}/histories/${ts}`,
|
||||
`/api/workspaces/${workspaceId}/docs/${pageDocId}/histories/${ts}`,
|
||||
{
|
||||
priority: 'high',
|
||||
}
|
||||
|
||||
+3
-1
@@ -140,7 +140,9 @@ export const AffineSharePage = (props: ShareMenuProps) => {
|
||||
lineHeight: '20px',
|
||||
}}
|
||||
value={
|
||||
isSharedPage ? sharingUrl : `${runtimeConfig.serverUrlPrefix}/...`
|
||||
isSharedPage
|
||||
? sharingUrl
|
||||
: `${location.protocol}//${location.hostname}/...`
|
||||
}
|
||||
readOnly
|
||||
/>
|
||||
|
||||
+4
-1
@@ -19,8 +19,11 @@ export const generateUrl = ({
|
||||
// to generate a public url like https://affine.app/share/123/456
|
||||
// or https://affine.app/share/123/456?mode=edgeless
|
||||
|
||||
const { protocol, hostname, port } = window.location;
|
||||
const url = new URL(
|
||||
`${runtimeConfig.serverUrlPrefix}/${urlType}/${workspaceId}/${pageId}`
|
||||
`${protocol}//${hostname}${
|
||||
port ? `:${port}` : ''
|
||||
}/${urlType}/${workspaceId}/${pageId}`
|
||||
);
|
||||
return url.toString();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user