fix: wrong session storage key if contains map

pull/224/head
Mingxing Liu 2 years ago committed by moonD4rk
parent d1bff59b8e
commit 5376184c7e
  1. 12
      browingdata/sessionstorage/sessionstorage.go

@ -67,7 +67,7 @@ func (c *ChromiumSessionStorage) Len() int {
} }
func (s *session) fillKey(b []byte) { func (s *session) fillKey(b []byte) {
keys := bytes.Split(b, []byte("\x00")) keys := bytes.Split(b, []byte("-"))
if len(keys) == 1 && bytes.HasPrefix(keys[0], []byte("META:")) { if len(keys) == 1 && bytes.HasPrefix(keys[0], []byte("META:")) {
s.IsMeta = true s.IsMeta = true
s.fillMetaHeader(keys[0]) s.fillMetaHeader(keys[0])
@ -75,6 +75,16 @@ func (s *session) fillKey(b []byte) {
if len(keys) == 2 && bytes.HasPrefix(keys[0], []byte("_")) { if len(keys) == 2 && bytes.HasPrefix(keys[0], []byte("_")) {
s.fillHeader(keys[0], keys[1]) s.fillHeader(keys[0], keys[1])
} }
if len(keys) == 3 {
if string(keys[0]) == "map"{
s.Key = string(keys[2])
} else if string(keys[0]) == "namespace"{
s.URL = string(keys[2])
s.Key = string(keys[1])
}
}
} }
func (s *session) fillMetaHeader(b []byte) { func (s *session) fillMetaHeader(b []byte) {

Loading…
Cancel
Save