Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Fix content disposition (#2303)" #2332

Merged
merged 1 commit into from
Dec 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion changelog/unreleased/fix-content-disposition.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Bugfix: Fix content disposition header for public links files

https://github.com/cs3org/reva/pull/2303
https://github.com/cs3org/reva/pull/2297
https://github.com/cs3org/reva/pull/2297
https://github.com/cs3org/reva/pull/2332
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,12 @@ func (s *service) translatePublicRefToCS3Ref(ctx context.Context, ref *provider.
return nil, "", nil, st, nil
}

cs3Ref := &provider.Reference{Path: path.Join("/", shareInfo.Path, relativePath)}
p := shareInfo.Path
if shareInfo.Type != provider.ResourceType_RESOURCE_TYPE_FILE {
p = path.Join("/", shareInfo.Path, relativePath)
}
cs3Ref := &provider.Reference{Path: p}

log.Debug().
Interface("sourceRef", ref).
Interface("cs3Ref", cs3Ref).
Expand Down
4 changes: 0 additions & 4 deletions internal/http/services/owncloud/ocdav/publicfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ func (h *PublicFileHandler) Handler(s *svc) http.Handler {
return
}

r.URL.Path = path.Base(r.URL.Path)
switch r.Method {
case MethodPropfind:
s.handlePropfindOnToken(w, r, h.namespace, false)
Expand Down Expand Up @@ -121,9 +120,6 @@ func (s *svc) adjustResourcePathInURL(w http.ResponseWriter, r *http.Request) bo
return false
}

// adjust path in request URL to point at the parent
r.URL.Path = path.Dir(r.URL.Path)

return true
}

Expand Down