From b104af5e4cd5de06dfde3a397eae3adc1127f112 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sat, 10 Jun 2023 01:59:56 -0400 Subject: [PATCH] refactor: change to use hash metadata key --- tus/tus.go | 4 ++-- tusstore/store.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tus/tus.go b/tus/tus.go index f953aa7..a1ecf49 100644 --- a/tus/tus.go +++ b/tus/tus.go @@ -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) } diff --git a/tusstore/store.go b/tusstore/store.go index d1200bb..3719cab 100644 --- a/tusstore/store.go +++ b/tusstore/store.go @@ -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