Use correct hash length when reading the push cookie

This commit is contained in:
Ken-Håvard Lieng 2018-04-30 22:53:29 +02:00
parent d4d03eac12
commit fb8fec38ff

View File

@ -214,11 +214,11 @@ func serveIndex(w http.ResponseWriter, r *http.Request) {
} else { } else {
pushed := false pushed := false
if files[1].Hash != cookie.Value[22:] { if files[1].Hash != cookie.Value[8:] {
pusher.Push("/"+files[1].Path, options) pusher.Push("/"+files[1].Path, options)
pushed = true pushed = true
} }
if files[0].Hash != cookie.Value[:22] { if files[0].Hash != cookie.Value[:8] {
pusher.Push("/"+files[0].Path, options) pusher.Push("/"+files[0].Path, options)
pushed = true pushed = true
} }