fix hmm... another stupid mistake

This commit is contained in:
Xiang Li 2013-10-17 00:12:39 -07:00
parent 28722e2127
commit 4479d72e93

View File

@ -1,6 +1,7 @@
package v1
import (
"fmt"
"net/http"
etcdErr "github.com/coreos/etcd/error"
@ -31,7 +32,7 @@ func SetKeyHandler(w http.ResponseWriter, req *http.Request, s Server) error {
// If the "prevValue" is specified then test-and-set. Otherwise create a new key.
var c raft.Command
if prevValueArr, ok := req.Form["prevValue"]; ok {
if len(prevValueArr) > 0 { // test against previous value
if len(prevValueArr[0]) > 0 { // test against previous value
c = &store.CompareAndSwapCommand{
Key: key,
Value: value,