mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-01 15:07:17 +08:00
fix: bucket mkdir may create path with empty whitespaces
This commit is contained in:
@@ -630,10 +630,7 @@ func (bucket *SBucket) PerformMakedir(
|
||||
data jsonutils.JSONObject,
|
||||
) (jsonutils.JSONObject, error) {
|
||||
key, _ := data.GetString("key")
|
||||
for len(key) > 0 && key[len(key)-1] == '/' {
|
||||
key = key[:len(key)-1]
|
||||
}
|
||||
|
||||
key = strings.Trim(key, " /")
|
||||
if len(key) == 0 {
|
||||
return nil, httperrors.NewInputParameterError("empty directory name")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user