Branchwell

Voxley / website · voxley.si / functions / careers / index.js

1// /careers was removed (2026-12-02). Answer /careers and /careers/ with the site's normal 404 page,
2// never from the asset layer, so a stale copy of the old careers page can't be served.
3export async function onRequest({ request, env }) {
4 let page = await env.ASSETS.fetch(new URL('/404.html', request.url));
5 const moved = page.status >= 300 && page.status < 400 && page.headers.get('Location');
6 if (moved) page = await env.ASSETS.fetch(new URL(moved, request.url));
7 return new Response(request.method === 'HEAD' ? null : page.body, {
8 status: 404,
9 headers: { 'Content-Type': 'text/html; charset=utf-8', 'Cache-Control': 'no-store' },
10 });
11}