aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclsr <clsr@clsr.net>2016-06-18 14:02:59 +0200
committerclsr <clsr@clsr.net>2016-06-18 14:02:59 +0200
commit44575299117f04897de897262ab66ce701d4b8ab (patch)
treeadd577fc56f9d5d1388a70a438857e7924a9ee15
parent2f1140173d9735a6c347747f09463eca4a61054a (diff)
downloadgomf-44575299117f04897de897262ab66ce701d4b8ab.tar.gz
gomf-44575299117f04897de897262ab66ce701d4b8ab.zip
Fix improper hash parsing in Storage.Getv0.2.3
-rw-r--r--storage.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/storage.go b/storage.go
index 11265b3..dbb313b 100644
--- a/storage.go
+++ b/storage.go
@@ -93,7 +93,10 @@ func (s *Storage) Get(id string) (file *os.File, hash string, size int64, modtim
if err != nil {
return
}
- bhash, _ := base64.RawStdEncoding.DecodeString(path.Base(path.Dir(target)))
+ bhash, err := base64.RawURLEncoding.DecodeString(path.Base(path.Dir(target)))
+ if err != nil {
+ return
+ }
hash = hex.EncodeToString(bhash)
if path.Ext(fn) != ext {
err = ErrNotFound{id + ext}