diff --git a/back-end-cf/index.js b/back-end-cf/index.js index d2c204c1..5b09ff05 100644 --- a/back-end-cf/index.js +++ b/back-end-cf/index.js @@ -180,7 +180,9 @@ async function authenticate(path, passwd) { `${path}/${PASSWD_FILENAME}`, null, true - ).then((resp) => (resp.status === 404 ? undefined : resp.text())); + ) + .then((resp) => (resp.status === 401 ? cacheFetch(resp.url) : resp)) + .then((resp) => (resp.status === 404 ? undefined : resp.text())); if (pwFileContent) { if (passwd !== pwFileContent) {