mirror of
https://github.com/dong-nz/cv.git
synced 2026-11-22 16:10:40 +07:00
fix(edit): probe a file that is not a draft document
The auth probe fetched src/data/profile.json, which every page manifest claims (the footer renders profile.name on every route), so the probe and the page's own document read hit the identical URL twice per session. PROBE_FILE is now AGENTS.md — a stable tracked file outside the draft scope. Spec row 27 records the fix and why nginx caching was rejected.
This commit is contained in:
1 parent
fcf8768d1a
commit
3fafbefe24
2 files changed
+8
-1
No files matched your search
@@ -6,7 +6,13 @@
|
||||
import { PROXY_BASE } from './draft';
|
||||
import { hasEditFlag } from './edit-session';
|
||||
|
||||
const PROBE_FILE = 'src/data/profile.json';
|
||||
// The probe must not be a draft document: every page manifest claims `profile`
|
||||
// (the footer renders `profile.name` on every route), so probing
|
||||
// `src/data/profile.json` made the auth check and the page's own document read
|
||||
// fetch the identical URL twice per session (owner report 2026-10-25). AGENTS.md
|
||||
// is a stable, tracked file on every branch, and the proxy passes any repository
|
||||
// path through unchanged.
|
||||
const PROBE_FILE = 'AGENTS.md';
|
||||
|
||||
function probeUrl(branch: string, cacheBust: boolean): string {
|
||||
const url = new URL(`${PROXY_BASE}${PROBE_FILE}`, window.location.origin);
|
||||
|
||||
Reference in new issue
Block a user