feat: [OCISDEV-330] drop remote.php prefix

The `remote.php` prefix is now fully optional in WebDAV endpoints and is never returned in responses.
This commit is contained in:
Lukas Hirt committed 2025-09-24 11:25:27 +02:00
1 parent 289c941e9e
commit 1b83d986f9
5 files changed
+15 -4

No files matched your search

@@ -0,0 +1,5 @@
Enhancement: Drop remote.php prefix
The `remote.php` prefix is now fully optional in WebDAV endpoints and is never returned in responses.
https://github.com/owncloud/ocis/pull/11687
+1 -1
View File
@@ -201,7 +201,7 @@ func FrontendConfigFromStruct(cfg *config.Config, logger log.Logger) (map[string
"capabilities": map[string]interface{}{
"core": map[string]interface{}{
"poll_interval": 60,
"webdav_root": "remote.php/webdav",
"webdav_root": "webdav",
"status": map[string]interface{}{
"installed": true,
"maintenance": false,
@@ -185,6 +185,11 @@ func DefaultPolicies() []config.Policy {
Endpoint: "/remote.php/?preview=1",
Service: "com.owncloud.web.webdav",
},
{
Type: config.QueryRoute,
Endpoint: "/?preview=1",
Service: "com.owncloud.web.webdav",
},
// TODO the actual REPORT goes to /dav/files/{username}, which is user specific ... how would this work in a spaces world?
// TODO what paths are returned? the href contains the full path so it should be possible to return urls from other spaces?
// TODO or we allow a REPORT on /dav/spaces to search all spaces and /dav/space/{spaceid} to search a specific space
+3 -2
View File
@@ -79,7 +79,7 @@ func Policies(qs string, opts ...Option) func(next http.Handler) http.Handler {
// this should only be used as last bastion, every request goes through the proxy and doing stats is expensive!
// needed for:
// - if a single resource is shared -> the url only contains the resourceID (spaceRef)
if resource.Name == "" && filepath.Ext(r.URL.Path) == "" && r.Method == http.MethodPut && strings.HasPrefix(r.URL.Path, "/remote.php/dav/spaces") {
if resource.Name == "" && filepath.Ext(r.URL.Path) == "" && r.Method == http.MethodPut && (strings.HasPrefix(r.URL.Path, "/remote.php/dav/spaces") || strings.HasPrefix(r.URL.Path, "/dav/spaces")) {
client, err := gatewaySelector.Next()
if err != nil {
logger.Err(err).Msg("error selecting next gateway client")
@@ -87,7 +87,8 @@ func Policies(qs string, opts ...Option) func(next http.Handler) http.Handler {
return
}
resourceID, err := storagespace.ParseID(strings.TrimPrefix(r.URL.Path, "/remote.php/dav/spaces/"))
path := strings.TrimPrefix(r.URL.Path, "/remote.php")
resourceID, err := storagespace.ParseID(strings.TrimPrefix(path, "/dav/spaces/"))
if err != nil {
logger.Debug().Err(err).Msg("error parsing the resourceId")
RenderError(w, r, req, http.StatusForbidden, DeniedMessage)
@@ -40,7 +40,7 @@ Feature: default capabilities for normal user
"const": 60
},
"webdav-root": {
"const": "remote.php/webdav"
"const": "webdav"
},
"status": {
"type": "object",