diff --git a/http/codegen/templates/partial/response.go.tpl b/http/codegen/templates/partial/response.go.tpl index 26f8033e4f..27ea2ba038 100644 --- a/http/codegen/templates/partial/response.go.tpl +++ b/http/codegen/templates/partial/response.go.tpl @@ -33,7 +33,7 @@ {{- end }} {{- if and (eq .Type.Name "string") (not (isAliased .FieldType)) }} - w.Header().Set("{{ .CanonicalName }}", {{ if or .FieldPointer $.ViewedResult }}*{{ end }}res{{ if $.ViewedResult }}.Projected{{ end }}{{ if .FieldName }}.{{ .FieldName }}{{ end }}) + w.Header().Add("{{ .CanonicalName }}", {{ if or .FieldPointer $.ViewedResult }}*{{ end }}res{{ if $.ViewedResult }}.Projected{{ end }}{{ if .FieldName }}.{{ .FieldName }}{{ end }}) {{- else }} {{- if not $checkNil }} { @@ -45,7 +45,7 @@ val := res{{ if $.ViewedResult }}.Projected{{ end }}{{ if .FieldName }}.{{ .FieldName }}{{ end }} {{ template "partial_header_conversion" (headerConversionData .Type (printf "%ss" .VarName) (not .FieldPointer) "val") }} {{- end }} - w.Header().Set("{{ .CanonicalName }}", {{ .VarName }}s) + w.Header().Add("{{ .CanonicalName }}", {{ .VarName }}s) {{- if not $checkNil }} } {{- end }} @@ -53,7 +53,7 @@ {{- if $initDef }} {{ if $checkNil }} } else { {{ else }}if res{{ if $.ViewedResult }}.Projected{{ end }}.{{ .FieldName }} == nil { {{ end }} - w.Header().Set("{{ .CanonicalName }}", "{{ printValue .Type .DefaultValue }}") + w.Header().Add("{{ .CanonicalName }}", "{{ printValue .Type .DefaultValue }}") {{- end }} {{- if or $checkNil $initDef }} @@ -116,4 +116,4 @@ {{- if .ErrorHeader }} w.Header().Set("goa-error", res.GoaErrorName()) {{- end }} - w.WriteHeader({{ .StatusCode }}) \ No newline at end of file + w.WriteHeader({{ .StatusCode }})