nyx/tests/dynamic_fixtures/header_injection/go/benign.go
2026-06-05 10:16:30 -05:00

15 lines
405 B
Go

// Phase 08 (Track J.6) — Go HEADER_INJECTION benign control fixture.
//
// Same shape as `vuln.go` but URL-encodes the value via
// `net/url.QueryEscape` before the header set, so CRLF bytes land as
// `%0D%0A` and the wire keeps a single header.
package benign
import (
"net/http"
"net/url"
)
func Run(w http.ResponseWriter, value string) {
w.Header().Set("Set-Cookie", url.QueryEscape(value))
}