| 12345678910111213141516 |
- package dom
- import (
- "strings"
- "testing"
- )
- func TestScriptArgumentsAreJSONEncoded(t *testing.T) {
- s := Script("read", map[string]string{"value": "\"});globalThis.attack=true;//\u2028"})
- if !strings.Contains(s, `\"});globalThis.attack=true;//\u2028`) {
- t.Fatal("argument was not encoded as data")
- }
- if !strings.Contains(source, "NodeFilter.SHOW_ELEMENT") || !strings.Contains(source, "4000") {
- t.Fatal("bounded walker missing")
- }
- }
|