Skip to content

Commit

Permalink
Use ParseBool for parsing Copy parameter in query-string
Browse files Browse the repository at this point in the history
  • Loading branch information
nono committed Jun 13, 2024
1 parent f54a4fd commit c6d7c4f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions web/remote/nextcloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"net/http"
"os"
"path/filepath"
"strconv"
"strings"

"github.com/cozy/cozy-stack/model/nextcloud"
Expand Down Expand Up @@ -202,7 +203,7 @@ func nextcloudDownstream(c echo.Context) error {
}

kind := nextcloud.MoveOperation
if c.QueryParam("Copy") != "" {
if isCopy, _ := strconv.ParseBool(c.QueryParam("Copy")); isCopy {
kind = nextcloud.CopyOperation
}

Expand Down Expand Up @@ -234,7 +235,7 @@ func nextcloudUpstream(c echo.Context) error {
}

kind := nextcloud.MoveOperation
if c.QueryParam("Copy") != "" {
if isCopy, _ := strconv.ParseBool(c.QueryParam("Copy")); isCopy {
kind = nextcloud.CopyOperation
}

Expand Down

0 comments on commit c6d7c4f

Please sign in to comment.