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:
@@ -4,8 +4,17 @@ import {
|
||||
assertPolicyMatchesHtmlDatasets,
|
||||
buildPageDataPolicyDatasetsFromRegistry,
|
||||
detectPageDataDatasetUsageFromHtml,
|
||||
htmlUsesForbiddenLegacyPageDataApi,
|
||||
htmlUsesPageDataApi,
|
||||
} from './page-data-html-detect.mjs';
|
||||
|
||||
test('htmlUsesForbiddenLegacyPageDataApi detects /api/page-data passthrough', () => {
|
||||
const html = `fetch('/api/page-data/daily_todo', { method: 'POST' })`;
|
||||
assert.equal(htmlUsesForbiddenLegacyPageDataApi(html), true);
|
||||
assert.equal(htmlUsesPageDataApi(html), true);
|
||||
assert.equal(detectPageDataDatasetUsageFromHtml(html).size, 0);
|
||||
});
|
||||
|
||||
test('detectPageDataDatasetUsageFromHtml finds insert and read datasets', () => {
|
||||
const html = `
|
||||
await c.insertRow('tkmind_exp_survey', { satisfaction: '满意' });
|
||||
|
||||
Reference in New Issue
Block a user