You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My current website is still under development. So I use an .htaccess authentication to restrict the access. Unfortunately, UpUp doesn't handle .htaccess authentication and accessing the site provide an 401 error.
After some reseach, some people (not using UpUp but hand made service worker) resolve this by using {'credentials': 'same-origin'} in fetch(), add() or addAll() methods. (See https://stackoverflow.com/a/47492920)
I change line 62 in upup.sw.js from : return new Request(urlToPrefetch, { mode: 'no-cors' });
to: return new Request(urlToPrefetch, { mode: 'no-cors', credentials: 'same-origin' });
And after clearing the cache, it seems to work.
If this is the correct way to make UpUp working with .htaccess authentication, maybe this option could be added in the code.
Let me know if this sounds interesting
Cheers.
Laurent.
Version used: 1.1.0
Browser Name and version: Chrome Version 75.0.3770.80 (Build officiel) (64 bits)
Operating System and version (desktop or mobile): Windows 10 Pro
The text was updated successfully, but these errors were encountered:
Hi,
My current website is still under development. So I use an .htaccess authentication to restrict the access. Unfortunately, UpUp doesn't handle .htaccess authentication and accessing the site provide an 401 error.
After some reseach, some people (not using UpUp but hand made service worker) resolve this by using
{'credentials': 'same-origin'}
infetch()
,add()
oraddAll()
methods. (See https://stackoverflow.com/a/47492920)I change line 62 in upup.sw.js from :
return new Request(urlToPrefetch, { mode: 'no-cors' });
to:
return new Request(urlToPrefetch, { mode: 'no-cors', credentials: 'same-origin' });
And after clearing the cache, it seems to work.
If this is the correct way to make UpUp working with .htaccess authentication, maybe this option could be added in the code.
Let me know if this sounds interesting
Cheers.
Laurent.
The text was updated successfully, but these errors were encountered: