Browse Source

Merge pull request #100 from xiangli-cmu/fix95

fixes #95
Xiang Li 12 years ago
parent
commit
6ac6dfcc52
1 changed files with 6 additions and 1 deletions
  1. 6 1
      store/store.go

+ 6 - 1
store/store.go

@@ -313,7 +313,12 @@ func (s *Store) Get(key string) ([]byte, error) {
 		return nil, err
 		return nil, err
 	}
 	}
 
 
-	if len(resps) == 1 {
+	key = path.Clean("/" + key)
+
+	// If the number of resps == 1 and the response key
+	// is the key we query, a signal key-value should
+	// be returned
+	if len(resps) == 1 && resps[0].Key == key {
 		return json.Marshal(resps[0])
 		return json.Marshal(resps[0])
 	}
 	}