feat: isolate TLS fingerprint for each extension lifecycle (#1135)

This commit is contained in:
Levi authored and GitHub committed 2025-10-09 20:37:21 +08:00
1 parent 20a70d7f91
commit 90f70d1bf6
3 files changed
+27 -14

No files matched your search

+13
View File
@@ -22,3 +22,16 @@ func AssertError[T error](err error) (t T, r bool) {
}
return
}
func SafeGet[T any](vm *goja.Runtime, name string) T {
v := vm.Get(name)
if v == nil {
var init T
return init
}
if e, ok := v.Export().(T); ok {
return e
}
var init T
return init
}