Skip to content

Commit

Permalink
Fix accessing an OCM-shared resource containing spaces (#4171)
Browse files Browse the repository at this point in the history
  • Loading branch information
gmgigi96 authored Sep 8, 2023
1 parent 569e0d3 commit 7c7612e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/fix-spaces-ocm-basic-auth.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Fix accessing an OCM-shared resource containing spaces

Fixes the access of a resource OCM-shared containing spaces, that
previously was failing with a `NotFound` error.

https://github.com/cs3org/reva/pull/4171
4 changes: 2 additions & 2 deletions internal/http/services/owncloud/ocdav/dav.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ package ocdav
import (
"context"
"net/http"
"net/url"
"path"
"path/filepath"
"strings"

gatewayv1beta1 "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1"
Expand Down Expand Up @@ -195,7 +195,7 @@ func (h *DavHandler) Handler(s *svc) http.Handler {
if ok {
// OCM 1.0
token = username
r.URL.Path, _ = url.JoinPath("/", token, r.URL.Path)
r.URL.Path = filepath.Join("/", token, r.URL.Path)
ctx = context.WithValue(ctx, ctxOCM10, true)
} else {
token, _ = router.ShiftPath(r.URL.Path)
Expand Down

0 comments on commit 7c7612e

Please sign in to comment.