diff --git a/changelog/unreleased/ocm-compat.md b/changelog/unreleased/ocm-compat.md new file mode 100644 index 00000000000..c5301ae2579 --- /dev/null +++ b/changelog/unreleased/ocm-compat.md @@ -0,0 +1,6 @@ +Bugfix: only expose paths on /ocm-provider + +Following analysis of OC and NC code to access a remote share, +we must expose paths and not full URIs on the /ocm-provider endpoint. + +https://github.com/reva/pull/3962 diff --git a/internal/http/services/ocmprovider/ocmprovider.go b/internal/http/services/ocmprovider/ocmprovider.go index a88f9e52a01..7d1bf9ebd7f 100644 --- a/internal/http/services/ocmprovider/ocmprovider.go +++ b/internal/http/services/ocmprovider/ocmprovider.go @@ -70,11 +70,17 @@ func (c *config) init() { c.Provider = "reva" } if c.WebdavRoot == "" { - c.WebdavRoot = "/remote.php/dav/ocm" + c.WebdavRoot = "/remote.php/dav/ocm/" } + if c.WebdavRoot[len(c.WebdavRoot)-1:] != "/" { + c.WebdavRoot = c.WebdavRoot + "/" + } if c.WebappRoot == "" { - c.WebappRoot = "/external/sciencemesh" + c.WebappRoot = "/external/sciencemesh/" } + if c.WebappRoot[len(c.WebappRoot)-1:] != "/" { + c.WebappRoot = c.WebappRoot + "/" + } } func (c *config) prepare() *discoveryData { @@ -99,12 +105,12 @@ func (c *config) prepare() *discoveryData { d.Provider = c.Provider rtProtos := map[string]string{} // webdav is always enabled - rtProtos["webdav"] = fmt.Sprintf("%s%s", c.Endpoint, c.WebdavRoot) + rtProtos["webdav"] = fmt.Sprintf("%s", c.WebdavRoot) if c.EnableWebapp { - rtProtos["webapp"] = fmt.Sprintf("%s%s", c.Endpoint, c.WebappRoot) + rtProtos["webapp"] = fmt.Sprintf("%s", c.WebappRoot) } if c.EnableDatatx { - rtProtos["datatx"] = fmt.Sprintf("%s%s", c.Endpoint, c.WebdavRoot) + rtProtos["datatx"] = fmt.Sprintf("%s", c.WebdavRoot) } d.ResourceTypes = []resourceTypes{{ Name: "file", // so far we only support `file`