Fix h2 push hash check

This commit is contained in:
Ken-Håvard Lieng 2019-02-01 06:39:38 +01:00
parent 3e90e6c86d
commit fad2e030d4

View File

@ -278,10 +278,10 @@ func (d *Dispatch) serveIndex(w http.ResponseWriter, r *http.Request) {
for _, asset := range h2PushAssets { for _, asset := range h2PushAssets {
if len(cookie.Value) >= i+len(asset.hash) && if len(cookie.Value) >= i+len(asset.hash) &&
asset.hash != cookie.Value[i:i+len(asset.hash)] { asset.hash != cookie.Value[i:i+len(asset.hash)] {
i += len(asset.hash)
pusher.Push(asset.path, options) pusher.Push(asset.path, options)
pushed = true pushed = true
} }
i += len(asset.hash)
} }
if pushed { if pushed {