-
-
Notifications
You must be signed in to change notification settings - Fork 235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to disable Service Worker #1018
Comments
This is supposed to be solved by this piece of code: openhab-webui/bundles/org.openhab.ui/web/src/components/app.vue Lines 377 to 401 in ec3cb6c
When the initial |
Ok I cleared the cache and will report back in the next days if the problem is resolved. |
@ghys still doesn't work. here are the details of the
|
I see, Apache2 may have removed the HTTP Reason phrases like "200 OK" or "401 Unauthorized" at some point, in which case the code above - which only checks those as it is the first argument of the Can you confirm it's the case? for example with Turns out a second argument with access to the actual status code, i.e. 401, is available, but it's ignored. This could probably be an easy fix. |
Yes, Apache does not send the status message |
@ghys I want to create a PR but I don't know how to get the complete error response instead of only the error string. |
@ghys Looking at
and the cordova-plugin-http documentation, there is an |
Don't worry about the Cordova API access layer too much, it's broken at the moment!
I believe you'll find it in the second argument in case the promise is rejected:
becomes:
and you will find the HTTP status in the
|
When retrying Also why don't we use async await syntax? |
) Use status code as fallback to the status message for error responses to detect whether the initial requests are unauthorized (HTTP 401). (With HTTP2 there is no status message and even in HTTP1 it is optional.) Fix #1018. Signed-off-by: Leon Kiefer <leon.k97@gmx.de>
The problem
There is a bug in chrome and other browsers, related to a problem in the Web Fetch API in combination with Service Workers and Basic Authentication, see whatwg/fetch#1132.
As a result it is not possible to use openHAB main ui behind a HTTPS reverse proxy with Basic Auth. On first page load it works. However one day later, the page is blank, because the Basic Auth prompt is not triggered by the Service Worker and therefore the access to the rest api is denied.
As you can see in the screenshot, the service worker caches the ui components, but the non-cached requests fail, because they don't trigger the Basic Auth prompt.
![image](https://user-images.githubusercontent.com/12752323/115990285-a6773200-a5c2-11eb-83ed-e8bac89eb36a.png)
Your suggestion
This is a bug in Browser, not openHAB ui. However, while this bug is present as a workaround, openHAB should allow to disable the service worker.
Your environment
Additional information
I use Apache Web Server as Reverse Proxy with TLS termination and Basic Auth.
The text was updated successfully, but these errors were encountered: