func main() {

	http.HandleFunc("/", func(writer http.ResponseWriter, request *http.Request) {
		if request.Method != http.MethodGet {
			writer.WriteHeader(http.StatusMethodNotAllowed)
		}
		writer.Header().Set("Content-Security-Policy-Report-Only", "default-src 'self'; report-uri http://localhost:8000/csp/violation-report/")
		_, _ = writer.Write([]byte(html))
	})

	err := http.ListenAndServe(":9000", nil)
	if err != nil {
		log.Fatal(err)
	}
}
// This is used as an e2e test for simulating csp violations
This is used as an e2e test for simulating csp violations
// This is used as an e2e test for simulating csp violations
func main() {
	http.HandleFunc("/", func(writer http.ResponseWriter, request *http.Request) {
		if request.Method != http.MethodGet {
			writer.WriteHeader(http.StatusMethodNotAllowed)
		}
		writer.Header().Set("Content-Security-Policy-Report-Only", "default-src 'self'; report-uri http://localhost:8000/csp/violation-report/")
		_, _ = writer.Write([]byte(html))
	})
	err := http.ListenAndServe(":9000", nil)
	if err != nil {
		log.Fatal(err)
	}
}
func main ( ) { http . HandleFunc ( " " , func ( writer http . ResponseWriter , request * http . Request ) { if request . Method != http . MethodGet { writer . WriteHeader ( http . StatusMethodNotAllowed ) } writer . Header ( ) . Set ( " " , " " ) _ , _ = writer . Write ( [ ] byte ( html ) ) } ) err := http . ListenAndServe ( " " , nil ) if err != nil { log . Fatal ( err ) } }
This is used as an e2e test for simulating csp violations
This is used as an e2e test for simulating csp violations