From 41d225af3b1c790c1ac92f88af1ec77f581c8def Mon Sep 17 00:00:00 2001 From: "Gerasimos (Makis) Maropoulos" Date: Fri, 14 Jun 2019 11:32:19 +0300 Subject: [PATCH] hero/mvc: func result -> struct, map, slices check if content type is already given by other output value before setting it, look the previous commit for more Former-commit-id: b2fcf1158ff2018889d2db81bfc7a5b4daab11c0 --- hero/func_result.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hero/func_result.go b/hero/func_result.go index faf50a0f..30cc005a 100644 --- a/hero/func_result.go +++ b/hero/func_result.go @@ -334,7 +334,7 @@ func DispatchFuncResult(ctx context.Context, errorHandler ErrorHandler, values [ if custom == nil { // if it's a pointer to struct/map. - if di.IsNil(v) { + if di.IsNil(v) && contentType == "" { // if just a ptr to struct with no content type given // then try to get the previous response writer's content type, // and if that is empty too then force-it to application/json