basic authorization header is not added to service worker fetch() network request
Categories
(Core :: DOM: Service Workers, defect, P5)
Tracking
()
People
(Reporter: bkelly, Unassigned)
References
(Depends on 1 open bug, Blocks 1 open bug)
Details
(Whiteboard: dom-lws-bugdash-triage)
Updated•9 years ago
|
Updated•9 years ago
|
| Reporter | ||
Comment 2•9 years ago
|
||
Comment 3•5 years ago
|
||
Bulk-downgrade of unassigned, >=3 years untouched DOM/Storage bug's priority.
If you have reason to believe this is wrong, please write a comment and ni :jstutte.
Updated•1 year ago
|
I ran into this issue while working on offline support for a personal storage / NAS setup, which uses basic auth for simplicity. When the auth-requiring page is reopened after a browser restart, no auth dialog is shown. Force-reloading (bypassing the serviceworker) can force the authentication dialog & get things unstuck, but that is not very usable for non-technical users.
Chrome / chromium shows a basic auth dialog when re-opening the page after a browser restart, as expected.
As a work-around, I found that firefox will show the auth dialog when the serviceworker does not return a response from the fetch handler. Basically:
if (resp.status === 401) {
// Firefox does not show the basic HTTP auth dialog when we return a
// 401 response from the SW, so return undefined and let the browser re-send
// the request directly.
// See https://bugzilla.mozilla.org/show_bug.cgi?id=1291893
return;
}
Description
•