Skip to content

Commit

Permalink
Use paths as opposed to full URIs in /ocm-provider
Browse files Browse the repository at this point in the history
  • Loading branch information
glpatcern committed Jun 11, 2023
1 parent 84ed9ad commit 77904fb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/ocm-compat.md
Original file line number Diff line number Diff line change
@@ -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
16 changes: 11 additions & 5 deletions internal/http/services/ocmprovider/ocmprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,16 @@ 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 += "/"
}
if c.WebappRoot == "" {
c.WebappRoot = "/external/sciencemesh"
c.WebappRoot = "/external/sciencemesh/"
}
if c.WebappRoot[len(c.WebappRoot)-1:] != "/" {
c.WebappRoot += "/"
}
}

Expand All @@ -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"] = c.WebdavRoot
if c.EnableWebapp {
rtProtos["webapp"] = fmt.Sprintf("%s%s", c.Endpoint, c.WebappRoot)
rtProtos["webapp"] = c.WebappRoot
}
if c.EnableDatatx {
rtProtos["datatx"] = fmt.Sprintf("%s%s", c.Endpoint, c.WebdavRoot)
rtProtos["datatx"] = c.WebdavRoot
}
d.ResourceTypes = []resourceTypes{{
Name: "file", // so far we only support `file`
Expand Down

0 comments on commit 77904fb

Please sign in to comment.