Skip to content

Commit

Permalink
archiver: strip extension prior to append zip or tar
Browse files Browse the repository at this point in the history
  • Loading branch information
glpatcern committed Aug 1, 2023
1 parent fdc2365 commit 6e4d173
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/http/services/archiver/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"net/http"
"path/filepath"
"regexp"
"strings"
"time"

gateway "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1"
Expand Down Expand Up @@ -243,7 +244,7 @@ func (s *svc) Handler() http.Handler {

var archName string
if len(files) == 1 {
archName = filepath.Base(files[0]) + "." + archType
archName = strings.TrimSuffix(filepath.Base(files[0]), filepath.Ext(files[0])) + "." + archType
} else {
// TODO(lopresti) we may want to generate a meaningful name out of the list
archName = s.config.Name + "." + archType
Expand Down

0 comments on commit 6e4d173

Please sign in to comment.