mirror of
https://codeberg.org/shroff/phylum.git
synced 2026-01-04 02:31:14 -06:00
[server][core] Always populate empty content type and sha256
This commit is contained in:
@@ -55,13 +55,7 @@ func (r Resource) CreateMemberResource(name string, id uuid.UUID, dir bool, conf
|
||||
var err error
|
||||
parent := r.ID()
|
||||
f := r.f.withDb(d)
|
||||
contentType := ""
|
||||
contentSHA256 := ""
|
||||
if dir {
|
||||
contentType = emptyContentType
|
||||
contentSHA256 = emptyContentSHA256
|
||||
}
|
||||
if result, created, _, err = f.createResource(id, parent, name, dir, 0, contentType, contentSHA256, conflictResolution); err != nil {
|
||||
if result, created, _, err = f.createResource(id, parent, name, dir, 0, emptyContentType, emptyContentSHA256, conflictResolution); err != nil {
|
||||
return err
|
||||
} else if created {
|
||||
if err := f.db.RecomputePermissions(r.f.ctx, id); err != nil {
|
||||
|
||||
@@ -63,6 +63,7 @@ func (s storage) OpenRead(id uuid.UUID, start, length int64) (io.ReadCloser, err
|
||||
return backend.OpenRead(id, start, length)
|
||||
}
|
||||
}
|
||||
|
||||
func (s storage) OpenWrite(id uuid.UUID, h func() hash.Hash, callback func(int, string, string) error) (io.WriteCloser, error) {
|
||||
if backend, err := s.findStorageBackend(id); err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user