Skip to content

Commit

Permalink
Escape download name (#4495)
Browse files Browse the repository at this point in the history
  • Loading branch information
diocas authored Feb 7, 2024
1 parent 989b01d commit 583fd2c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/http/services/owncloud/ocdav/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"fmt"
"io"
"net/http"
"net/url"
"path"
"strconv"
"strings"
Expand Down Expand Up @@ -121,7 +122,7 @@ func (s *svc) handleGet(ctx context.Context, w http.ResponseWriter, r *http.Requ

w.Header().Set(HeaderContentType, info.MimeType)
w.Header().Set(HeaderContentDisposistion, "attachment; filename*=UTF-8''"+
path.Base(r.URL.Path)+"; filename=\""+path.Base(r.URL.Path)+"\"")
url.PathEscape(path.Base(r.URL.Path))+"; filename=\""+path.Base(r.URL.Path)+"\"")
w.Header().Set(HeaderETag, info.Etag)
w.Header().Set(HeaderOCFileID, resourceid.OwnCloudResourceIDWrap(info.Id))
w.Header().Set(HeaderOCETag, info.Etag)
Expand Down

0 comments on commit 583fd2c

Please sign in to comment.