From ec7168e718e3e68f0bba475ba64a61e44c3760b2 Mon Sep 17 00:00:00 2001 From: Pierre Dubouilh Date: Sun, 8 Sep 2019 18:13:08 +0200 Subject: [PATCH] shift hash setup --- src/gossa.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gossa.go b/src/gossa.go index 4e915f6..85d0cd3 100755 --- a/src/gossa.go +++ b/src/gossa.go @@ -163,7 +163,11 @@ func rpc(w http.ResponseWriter, r *http.Request) { } else if rpc.Call == "rm" { err = os.RemoveAll(checkPath(rpc.Args[0])) } else if rpc.Call == "historySet" && *history { - state[hash(r.Header.Get("Authorization")+rpc.Args[0])] = rpc.Args[1] // first arg is always hashed (url), second is hashed on the browser depending on payload + if rpc.Args[2] == "hash" { + state[hash(r.Header.Get("Authorization")+rpc.Args[0])] = hash(rpc.Args[1]) + } else { + state[hash(r.Header.Get("Authorization")+rpc.Args[0])] = rpc.Args[1] + } f, _ := json.MarshalIndent(state, "", " ") ioutil.WriteFile(historyPath, f, 0644) } else if rpc.Call == "historyGet" && *history {