refactor: change to use hash metadata key
This commit is contained in:
parent
b77bebe3b1
commit
b104af5e4c
|
@ -23,7 +23,7 @@ import (
|
|||
|
||||
const TUS_API_PATH = "/files/tus"
|
||||
|
||||
const HASH_META_HEADER = "blake3-hash"
|
||||
const HASH_META_HEADER = "hash"
|
||||
|
||||
func Init() *tusd.Handler {
|
||||
store := &tusstore.DbFileStore{
|
||||
|
@ -46,7 +46,7 @@ func Init() *tusd.Handler {
|
|||
hash := hook.Upload.MetaData[HASH_META_HEADER]
|
||||
|
||||
if len(hash) == 0 {
|
||||
msg := "missing blake3-hash metadata"
|
||||
msg := "missing hash metadata"
|
||||
logger.Get().Debug(msg)
|
||||
return errors.New(msg)
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ func (store DbFileStore) NewUpload(ctx context.Context, info handler.FileInfo) (
|
|||
upload := &fileUpload{
|
||||
info: info,
|
||||
binPath: binPath,
|
||||
hash: info.MetaData["blake3-hash"],
|
||||
hash: info.MetaData["hash"],
|
||||
}
|
||||
|
||||
// writeInfo creates the file by itself if necessary
|
||||
|
|
Loading…
Reference in New Issue