refactor: change to use hash metadata key

This commit is contained in:
Derrick Hammer 2023-06-10 01:59:56 -04:00
parent b77bebe3b1
commit b104af5e4c
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
2 changed files with 3 additions and 3 deletions

View File

@ -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)
}

View File

@ -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