Bug 1459550

Summary: nextcloud: Detect 301 redirects from http to https
Product: Red Hat Enterprise Linux 8 Reporter: Matěj Cepl <mcepl>
Component: gnome-online-accountsAssignee: Debarshi Ray <debarshir>
Status: CLOSED WONTFIX QA Contact: Desktop QE <desktop-qa-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.3CC: jan.public, tpelka, tpopela
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-12-01 07:28:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Matěj Cepl 2017-06-07 12:37:19 UTC
Description of problem (from the upstream bug):
[reply] [−] Description Debarshi Ray [reporter] [gnome-online-accounts developer] 2017-06-07 13:59:14 CEST

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.

Version-Release number of selected component (if applicable):
libsoup-2.56.0-2.el7.x86_64
gvfs-1.30.4-3.el7.x86_64
gnome-online-accounts-3.22.5-1.el7.x86_64
gvfs-goa-1.30.4-3.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Create ownCloud account in GOA on http://my.owndrive.com
2. Start Nautilus and go to the ownCloud shortcut created there
3.

Actual results:
Error message:
Unable to access 'desktopqe.com' HTTP Error: Moved Permanently

Expected results:
redirect should happen silently behind the scenes, if it needs to happen

Additional info:

Comment 2 Matěj Cepl 2017-06-20 16:06:00 UTC
Most likely the same as bug 1461066 for Fedora?

Comment 3 Debarshi Ray 2017-06-20 17:59:23 UTC
No, bug 1461066 looks different.

Comment 4 Debarshi Ray 2020-02-21 11:05:05 UTC
RHEL 7 is approaching its Extended Life Cycle Support phase. Given the non-critical nature of this bug, it's not fit for RHEL 7 anymore. Let's try to fix this for RHEL 8.

Comment 7 RHEL Program Management 2020-12-01 07:28:57 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.