From 70a4662e25e28d3e48db30442c78e178bd76e6cd Mon Sep 17 00:00:00 2001 From: Kent Quirk Date: Mon, 31 Oct 2022 21:08:43 -0400 Subject: [PATCH] Set content-type on marshalToFormat --- route/route.go | 1 + 1 file changed, 1 insertion(+) diff --git a/route/route.go b/route/route.go index 8727ac637b..8c47c7dbdb 100644 --- a/route/route.go +++ b/route/route.go @@ -332,6 +332,7 @@ func (r *Router) marshalToFormat(w http.ResponseWriter, obj interface{}, format w.WriteHeader(http.StatusBadRequest) return } + w.Header().Set("Content-Type", "application/"+format) w.Write(body) }