openhab/openhab-ios

MainUI is not working via myopenHAB when `Default Path` is set

Closed this issue · 3 comments

New bug checklist

Describe the bug

When I am access my openHAB server remotely by using myopenHAB, the openHAB iOS app properly loads the MainUI.
If I set up a default path in the iOS App Settings, that is working locally, MainUI won‘t load remotely, but instead a „Fehler 400“ (means HTTP error 400 — webpage cannot be found?) toast notification is shown.

To Reproduce

Steps to reproduce the behavior:

  1. Set up a Default Path for MainUI in the openHAB iOS client
  2. Connect locally to check whether the path works, if it does, go on
  3. Connect remotely

Expected behavior

The default path should work for both local and remote access.

App:

  • Version [e.g. 2.1.0 (12)]: 2.4.57 (1580410432)

Smartphone:

  • Device: [e.g. iPhoneXR]: iPhone XS

openHAB:

  • Version [e.g. 2.5.8]: 3.4.0.M4

Additional context

I think the probem is related to openhab/openhab-webui#1521 and/or openhab/openhab-addons#13559.

Yep, i can reproduce this as well, strange, i will take a look.

So this is a little odd. Somewhere in the Main UI its doing a redirect when you try to navigate directly to a route. This redirect is the route with the trailing slash appended. Since the local connection from the cloud addon back to openHAB on localhost is using http (and not https) , it sends a redirect to http://home.myopenhab.org:443/page/somepage/ , which is obviously not going to work. This may be a tough one to fix in the MainUI or addon, and in any case, users may not upgrade those for awhile so i have a workaround in #701 to address.

@florian-h05 you can try this out by manually editing the default path and add a trailing / to it.

@digital With the latest version (Version 2.4.57 (1580410533) it’s not working at all when a default path is set.
Whether it ends with a slash or not, I always get a the following page:
F34281FA-A832-4011-A56B-528F98FA7C8D