Giter Site home page Giter Site logo

Comments (7)

DeepDiver1975 avatar DeepDiver1975 commented on June 8, 2024

further details:
we should not rely on welknow because it could be possible that there are multiple owncloud instances running and the contacts app should always connect to its own instance.

from contacts.

Henni avatar Henni commented on June 8, 2024

This is part of the dav lib. We might have to hack in and disable the well-known-request.

from contacts.

nickvergessen avatar nickvergessen commented on June 8, 2024
diff --git a/js/public/script.js b/js/public/script.js
index 6035cec..771e10b 100644
--- a/js/public/script.js
+++ b/js/public/script.js
@@ -468,6 +468,7 @@ app.service('DavClient', function() {
 app.service('DavService', ['DavClient', function(client) {
    return client.createAccount({
        server: OC.linkToRemoteBase('dav/addressbooks'),
+       useProvidedPath: true,
        accountType: 'carddav'
    });
 }]);
diff --git a/js/services/dav_service.js b/js/services/dav_service.js
index 0606584..9981d37 100644
--- a/js/services/dav_service.js
+++ b/js/services/dav_service.js
@@ -1,6 +1,7 @@
 app.service('DavService', ['DavClient', function(client) {
    return client.createAccount({
        server: OC.linkToRemoteBase('dav/addressbooks'),
-       accountType: 'carddav'
+       accountType: 'carddav',
+       useProvidedPath: true
    });
 }]);
diff --git a/js/vendor/dav/dav.js b/js/vendor/dav/dav.js
index 4844c34..a961ed4 100644
--- a/js/vendor/dav/dav.js
+++ b/js/vendor/dav/dav.js
@@ -683,7 +683,7 @@ var serviceDiscovery = _co2['default'].wrap(regeneratorRuntime.mark(function cal
         uri = _url2['default'].format({
           protocol: endpoint.protocol,
           host: endpoint.host,
-          pathname: '/.well-known/' + options.accountType
+          pathname: (!options.useProvidedPath ? '/.well-known/' + options.accountType : endpoint.pathname)
         });
         req = request.basic({ method: 'GET' });
         context$1$0.prev = 5;

This worked, but I don't feel very comfortable patching a JS lib. Also there is now a GET and a PROPFIND on the same URL, not sure if this is intended?

from contacts.

Henni avatar Henni commented on June 8, 2024

@nickvergessen thanks for looking into this.
It seems like the dav library was the wrong choice. Therefore we will probably exchange the library for davclient.js in version 2.0 which is already used by core (files) and calendar.
But for version 1.0 we should keep it. So let's fix this as hacky as we want for now.

@DeepDiver1975 do you agree on this?

from contacts.

DeepDiver1975 avatar DeepDiver1975 commented on June 8, 2024

But for version 1.0 we should keep it. So let's fix this as hacky as we want for now.

what about sucking in the dav client lib so that we can for now easier adjust it?

from contacts.

Henni avatar Henni commented on June 8, 2024

@DeepDiver1975 you mean instead of importing it via bower?
If so, yes let's do that.

from contacts.

DeepDiver1975 avatar DeepDiver1975 commented on June 8, 2024

you mean instead of importing it via bower?

yes - just copy and paste

from contacts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.