fix(page-data): harden structural delivery and Portal base URL
Reject /api/page-data/ legacy passthrough, verify live API before send, and resolve delivery links to Portal (8081) instead of Vite (5173). Add local repair/verify scripts for daily-register Page Data flow. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -3,6 +3,11 @@
|
||||
*/
|
||||
|
||||
const PAGE_DATA_CLIENT_SCRIPT_PATTERN = /\/assets\/page-data-client\.js/i;
|
||||
const FORBIDDEN_LEGACY_PAGE_DATA_API_PATTERN = /\/api\/page-data\b/i;
|
||||
|
||||
export function htmlUsesForbiddenLegacyPageDataApi(html) {
|
||||
return FORBIDDEN_LEGACY_PAGE_DATA_API_PATTERN.test(String(html ?? ''));
|
||||
}
|
||||
|
||||
export function htmlUsesPageDataApi(html) {
|
||||
const content = String(html ?? '');
|
||||
@@ -10,7 +15,8 @@ export function htmlUsesPageDataApi(html) {
|
||||
return (
|
||||
usage.size > 0 ||
|
||||
PAGE_DATA_CLIENT_SCRIPT_PATTERN.test(content) ||
|
||||
/\bMindSpacePageData\b/.test(content)
|
||||
/\bMindSpacePageData\b/.test(content) ||
|
||||
htmlUsesForbiddenLegacyPageDataApi(content)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user