Skip to content

Commit

Permalink
Return invalid file ID in appprovider
Browse files Browse the repository at this point in the history
  • Loading branch information
ishank011 committed Oct 5, 2021
1 parent 22611c0 commit f865d78
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/http/services/appprovider/appprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,12 +332,12 @@ func (s *svc) getStatInfo(ctx context.Context, fileID string, client gateway.Gat

decodedID, err := base64.URLEncoding.DecodeString(fileID)
if err != nil {
return nil, ocmd.APIErrorInvalidParameter, errors.Wrap(err, "fileID doesn't follow the required format")
return nil, ocmd.APIErrorInvalidParameter, errors.Wrap(err, fmt.Sprintf("fileID %s doesn't follow the required format", fileID))
}

parts := strings.Split(string(decodedID), idDelimiter)
if !utf8.ValidString(parts[0]) || !utf8.ValidString(parts[1]) {
return nil, ocmd.APIErrorInvalidParameter, errors.New("fileID contains illegal characters")
return nil, ocmd.APIErrorInvalidParameter, errors.New(fmt.Sprintf("fileID %s contains illegal characters", fileID))
}
res := &provider.ResourceId{
StorageId: parts[0],
Expand Down

0 comments on commit f865d78

Please sign in to comment.