write all passed header in response

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-03-01 11:35:19 +03:00
parent f7ed037633
commit 45670661d0

View File

@ -224,6 +224,12 @@ func (h *httpHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
return return
} }
if md, ok := metadata.FromOutgoingContext(ctx); ok {
for k, v := range md {
w.Header().Set(k, v)
}
}
w.Header().Set("content-Type", ct) w.Header().Set("content-Type", ct)
if scode != 0 { if scode != 0 {
w.WriteHeader(scode) w.WriteHeader(scode)