Skip to content

Commit

Permalink
Merge pull request #605 from gocsaf/dev-17
Browse files Browse the repository at this point in the history
fix: Content-Type header for JSON responses (minor)
  • Loading branch information
koplas authored Jan 17, 2025
2 parents 1daaed2 + 95ff418 commit 5907a39
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/csaf_provider/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func (c *controller) web(
// writeJSON sets the header for the response and writes the JSON encoding of the given "content".
// It logs out an error message in case of an error.
func writeJSON(rw http.ResponseWriter, content any, code int) {
rw.Header().Set("Content-type", "application/json; charset=utf-8")
rw.Header().Set("Content-type", "application/json")
rw.Header().Set("X-Content-Type-Options", "nosniff")
rw.WriteHeader(code)
if err := json.NewEncoder(rw).Encode(content); err != nil {
Expand Down

0 comments on commit 5907a39

Please sign in to comment.