Skip to content

Commit

Permalink
chore(rest): Ignore semgrep warning about directly writing to http re…
Browse files Browse the repository at this point in the history
…sponse in test util

Semgrep rule go.lang.security.audit.xss.no-direct-write-to-responsewriter.no-direct-write-to-responsewriter
warn about directly writing random content to a http repsonse without HTML escaped templating.

As this case is a test util used to supply test with defined responses loaded from json
test resources, the warning is marked ignored.
  • Loading branch information
UnseenWizzard committed Feb 14, 2023
1 parent 199931d commit 3b10d37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/rest/test_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (i integrationTestResources) handler() func(res http.ResponseWriter, req *h
http.Error(res, "Not found", http.StatusNotFound)
return
} else {
_, err := res.Write(content)
_, err := res.Write(content) // nosemgrep: go.lang.security.audit.xss.no-direct-write-to-responsewriter.no-direct-write-to-responsewriter
if err != nil {
http.Error(res, err.Error(), http.StatusInternalServerError)
}
Expand Down

0 comments on commit 3b10d37

Please sign in to comment.