diff --git a/functions/v2/[[image]].js b/functions/v2/[[image]].js index 941b455..33cf92f 100644 --- a/functions/v2/[[image]].js +++ b/functions/v2/[[image]].js @@ -18,19 +18,19 @@ export function onRequest(context) { url.port = ""; // If the path is just /v2 then redirect upstream - if (url.pathname == "/v2" || url.pathname == "/v2/") { - return Response.redirect(TARGET_URL.toString(), 302); - } + // if (url.pathname == "/v2" || url.pathname == "/v2/") { + // return Response.redirect(TARGET_URL.toString(), 302); + // } - // If the path starts with an allowed user, redirect to the new url - for (var user of ALLOWED_EXTRA_USERS) { - if (url.pathname.startsWith(`/v2/${user}/`)) { - return Response.redirect(url.toString(), 302); - } - } + // // If the path starts with an allowed user, redirect to the new url + // for (var user of ALLOWED_EXTRA_USERS) { + // if (url.pathname.startsWith(`/v2/${user}/`)) { + // return Response.redirect(url.toString(), 302); + // } + // } - // Inject the default user into the path after /v2/ - url.pathname = url.pathname.replace("/v2/", `/v2/${DEFAULT_USER}/`); + // // Inject the default user into the path after /v2/ + // url.pathname = url.pathname.replace("/v2/", `/v2/${DEFAULT_USER}/`); // Redirect to the new url return Response.redirect(url.toString(), 302);