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
[carddav] Improve URL path repetition detection logic #6
Conversation
Some services (such as self-hosted OwnCloud servers) have a base url which includes both a host and a path segment. When performing later requests to another path (e.g., a user principals url request), we need to ensure that we do not duplicate the suffix path-segment from the base url, as it may already appear as a prefix in the request-path. e.g.: baseUrl: http://my.oc.tld/owncloud/remote.php/carddav request: /owncloud/remote.php/carddav/principals/fred result: http://my.oc.tld/owncloud/remote.php/carddav/principals/fred
LGTM. |
@chriadam I'd love to test the patch against my ownCloud instance, but I can't get buteo-sync-plugin-carddav to build in the latest SailfishOS IDE 1412. Do I need another IDE, or do anything else besides opening and building it in the regular Sailfish IDE to make this work?
|
@florianjacob I normally use the command line to build. Does your version of the sdk come with the "mb2" tool? That is what I use to build rpm packages locally. Otherwise, qmake && make -j5 and then scp the executable to the /usr/lib/buteo-plugins-qt5/oopp/ directory. |
Actually, I think this PR is wrong, after all. Instead of merely detecting path segment duplication, we should rather assume that the path fragment is a complete, absolute path. |
Some services (such as self-hosted OwnCloud servers) have a base url
which includes both a host and a path segment. When performing later
requests to another path (e.g., a user principals url request), we
need to ensure that we do not duplicate the suffix path-segment from
the base url, as it may already appear as a prefix in the request-path.
e.g.:
baseUrl: http://my.oc.tld/owncloud/remote.php/carddav
request: /owncloud/remote.php/carddav/principals/fred
result: http://my.oc.tld/owncloud/remote.php/carddav/principals/fred