Skip to content

Commit df50581

Browse files
committed
test for cutting off location of owner check
1 parent 195d357 commit df50581

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pkg/http/data.go

+6-3
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,12 @@ func CheckPathOwner(r *http.Request, prefix string) (bool, error) {
6464
}
6565

6666
dst := r.URL.Query().Get("destination")
67-
dstType := r.URL.Query().Get("dst_type")
68-
if dstType == "" {
69-
dstType = drives.SrcTypeDrive
67+
dstType := ""
68+
if dst != "" {
69+
dstType = r.URL.Query().Get("dst_type")
70+
if dstType == "" {
71+
dstType = drives.SrcTypeDrive
72+
}
7073
}
7174

7275
klog.Infof("Checking owner for method: %s, prefix: %s, srcType: %s, src: %s, dstType: %s, dst: %s", method, prefix, srcType, src, dstType, dst)

0 commit comments

Comments
 (0)