Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions _worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ export default {
}

for (const [prefix, origin] of Object.entries(SUBPROJECTS)) {
// Bare project root without trailing slash (/projects/etl) β€” redirect
// to the canonical slash form, otherwise it falls through to the
// umbrella's static assets and 404s. Deeper slash-less paths don't
// need this: the proxied Pages project 308s them itself.
if (url.pathname === prefix.slice(0, -1)) {
url.pathname = prefix;
return Response.redirect(url.toString(), 301);
}
if (url.pathname.startsWith(prefix)) {
const target = `${origin}${url.pathname}${url.search}`;
return fetch(target, request);
Expand Down
Loading