| 1 | export const BUILD_HEADER = "x-g1t-build"; |
| 2 | |
| 3 | /** Only safe route reads can switch builds automatically; never replay writes. */ |
| 4 | export function needsBuildRefresh(request: Request, build: string): boolean { |
| 5 | const requested = request.headers.get(BUILD_HEADER); |
| 6 | return request.method === "GET" && new URL(request.url).pathname.endsWith(".data") && requested !== null && requested !== build; |
| 7 | } |