pentest: bind unlock cookie to HMAC per-paste token; serve only safe content types on /raw and can items with nosniff (#34)
CI / test (push) Successful in 21s
CI / docker (push) Skipped

This commit is contained in:
2026-09-09 00:14:01 -05:00
parent 15ce7ff011
commit cb23707125
6 changed files with 195 additions and 5 deletions
+16
View File
@@ -0,0 +1,16 @@
package main
import (
"encoding/json"
"testing"
)
// test helpers for pentest tests (#34)
func jsonField(tb testing.TB, body, field string) string {
var m map[string]any
if err := json.Unmarshal([]byte(body), &m); err != nil {
tb.Fatalf("bad json: %v", err)
}
v, _ := m[field].(string)
return v
}