Skip to content

Commit

Permalink
Sanitize input
Browse files Browse the repository at this point in the history
  • Loading branch information
glpatcern committed Aug 14, 2024
1 parent 85447a0 commit 1140ae7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/ocm/storage/outcoming/ocm.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,9 @@ func (d *driver) Upload(ctx context.Context, ref *provider.Reference, content io
if err != nil {
return err
}
if metadata == nil {
metadata = map[string]string{}
}

return d.unwrappedOpFromShareCreator(ctx, share, rel, func(ctx context.Context, newRef *provider.Reference) error {
initRes, err := d.gateway.InitiateFileUpload(ctx, &provider.InitiateFileUploadRequest{
Expand Down
3 changes: 3 additions & 0 deletions pkg/storage/utils/eosfs/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ func (fs *eosfs) Upload(ctx context.Context, ref *provider.Reference, r io.ReadC
return err
}

if metadata == nil {
metadata = map[string]string{}
}
app := metadata["lockholder"]
if app == "" {
app = "reva_eosclient::write"
Expand Down

0 comments on commit 1140ae7

Please sign in to comment.