Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

chriadam
Copy link
Contributor

@chriadam chriadam commented Jan 5, 2015

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

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
@VDVsx
Copy link

VDVsx commented Jan 5, 2015

LGTM.

@florianjacob
Copy link

@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?

23:05:12: Starting "/home/florian/.config/SailfishBeta1/mer-sdk-tools/MerSDK/SailfishOS-armv7hl/qmake" /home/florian/Programming/SailfishOS/buteo-sync-plugin-carddav/buteo-sync-plugin-carddav.pro -r -spec linux-g++ CONFIG+=debug
Building target platforms: armv7hl-meego-linux
Building for target armv7hl-meego-linux
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.qaP8iz
Usage: /usr/lib/qt5/bin/qmake [mode] [options] [files]

QMake has two modes, one mode for generating project files based on
some heuristics, and the other for generating makefiles. Normally you
shouldn't need to specify a mode, as makefile generation is the default
mode for qmake, but you may use this to test qmake on an existing project

Mode:
  -project       Put qmake into project file generation mode
                 In this mode qmake interprets files as files to
                 be built,
                 defaults to *; *; *; *.ts; *.xlf; *.qrc
                 Note: The created .pro file probably will 
                 need to be edited. For example add the QT variable to 
                 specify what modules are required.
  -makefile      Put qmake into makefile generation mode (default)
                 In this mode qmake interprets files as project files to
                 be processed, if skipped qmake will try to find a project
                 file in your current working directory

Warnings Options:
  -Wnone         Turn off all warnings; specific ones may be re-enabled by
                 later -W options
  -Wall          Turn on all warnings
  -Wparser       Turn on parser warnings
  -Wlogic        Turn on logic warnings (on by default)
  -Wdeprecated   Turn on deprecation warnings (on by default)

Options:
   * You can place any variable assignment in options and it will be     *
   * processed as if it was in [files]. These assignments will be parsed *
   * before [files].                                                     *
  -o file        Write output to file
  -d             Increase debug level
  -t templ       Overrides TEMPLATE as templ
  -tp prefix     Overrides TEMPLATE so that prefix is prefixed into the value
  -help          This help
  -v             Version information
  -after         All variable assignments after this will be
                 parsed after [files]
  -norecursive   Don't do a recursive search
  -recursive     Do a recursive search
  -set <prop> <value> Set persistent property
  -unset <prop>  Unset persistent property
  -query <prop>  Query persistent property. Show all if <prop> is empty.
  -cache file    Use file as cache           [makefile mode only]
  -spec spec     Use spec as QMAKESPEC       [makefile mode only]
  -nocache       Don't use a cache file      [makefile mode only]
  -nodepend      Don't generate dependencies [makefile mode only]
  -nomoc         Don't generate moc targets  [makefile mode only]
  -nopwd         Don't look for files in pwd [project mode only]


RPM build errors:
error: Bad exit status from /var/tmp/rpm-tmp.qaP8iz (%build)
    Bad exit status from /var/tmp/rpm-tmp.qaP8iz (%build)

@chriadam
Copy link
Contributor Author

@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.

@chriadam
Copy link
Contributor Author

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.
See: #7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants