Merge lp:~xavi-garcia-mena/storage-provider-webdav/base-url-host-fix-to-trunk into lp:storage-provider-webdav

Proposed by Xavi Garcia
Status: Merged
Approved by: James Henstridge
Approved revision: 13
Merged at revision: 13
Proposed branch: lp:~xavi-garcia-mena/storage-provider-webdav/base-url-host-fix-to-trunk
Merge into: lp:storage-provider-webdav
Diff against target: 14 lines (+3/-1)
1 file modified
src/OwncloudProvider.cpp (+3/-1)
To merge this branch: bzr merge lp:~xavi-garcia-mena/storage-provider-webdav/base-url-host-fix-to-trunk
Reviewer Review Type Date Requested Status
James Henstridge Approve
Review via email: mp+317068@code.launchpad.net

Commit message

Fix to use the host included in credentials when building the base_url.

Description of the change

Fix to use the host included in credentials when building the base_url.

This should fix the issue we have using any owncloud server located at any url different from localhost:8888/owncloud.

To post a comment you must log in.
Revision history for this message
James Henstridge (jamesh) wrote :

Looks good.

review: Approve
Revision history for this message
Charles Kerr (charlesk) wrote :

:D

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/OwncloudProvider.cpp'
2--- src/OwncloudProvider.cpp 2016-11-18 04:34:55 +0000
3+++ src/OwncloudProvider.cpp 2017-02-13 08:31:22 +0000
4@@ -34,7 +34,9 @@
5 QUrl OwncloudProvider::base_url(Context const& ctx) const
6 {
7 const auto& creds = boost::get<PasswordCredentials>(ctx.credentials);
8- return QUrl(QStringLiteral("http://localhost:8888/owncloud/remote.php/dav/files/%1/").arg(QString::fromStdString(creds.username)));
9+ // get the host, removing any '/' at the end
10+ auto host = QString::fromStdString(creds.host).remove(QRegExp("/*$"));
11+ return QUrl(QStringLiteral("%1/remote.php/dav/files/%2/").arg(host).arg(QString::fromStdString(creds.username)));
12 }
13
14 QNetworkReply *OwncloudProvider::send_request(

Subscribers

People subscribed via source and target branches

to all changes: