GNOME Bugzilla – Bug 783506
nextcloud: Detect 301 redirects from http to https
Last modified: 2021-07-05 10:58:59 UTC
When adding a Nextcloud account, unless one explicitly specifies the URI scheme, it assumes that it is HTTPS. However, if someone specifies HTTP, it will stick to it. This leads to a strange problem with my.owndrive.com. Sending a GET request to http://my.owndrive.com/remote.php/webdav evokes a successful (200) response, which is fine. However, an OPTIONS request leads to a 301 redirect with the Location header set to https://my.owndrive.com/remote.php/webdav. ie. the HTTPS equivalent of the same URL. Therefore, if one explicitly specifies HTTP in Settings -> Online Accounts, the account will be added because it uses GET requests. However, GVfs' WebDAV backend won't be able to mount it because it sends an OPTIONS request and the redirect handler refuses to grant the redirect request. A quick reading of the WebDAV backend code makes me think that redirects are tied to G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS. So, while we might be able to make the backend deal with this, it might be easier to teach g-o-a to detect this when adding the account and only advertise the HTTPS URL.
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/gnome-online-accounts/-/issues/ Thank you for your understanding and your help.