Skip to content

Commit

Permalink
file/files: resource ID can have only 2 segments when the path is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
manicminer committed Mar 26, 2024
1 parent dfcf14b commit 369a2c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions storage/2023-11-03/file/files/resource_id.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ func ParseFileID(input, domainSuffix string) (*FileId, error) {

path := strings.TrimPrefix(uri.Path, "/")
segments := strings.Split(path, "/")
if len(segments) < 3 {
return nil, fmt.Errorf("expected the path to contain at least 3 segments but got %d", len(segments))
if len(segments) < 2 {
return nil, fmt.Errorf("expected the path to contain at least 2 segments but got %d", len(segments))
}
shareName := segments[0]
directoryPath := strings.Join(segments[1:len(segments)-1], "/")
Expand Down

0 comments on commit 369a2c1

Please sign in to comment.