dont mangle header names #143
18
handler.go
18
handler.go
@ -79,16 +79,16 @@ func (h *httpServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||||||
md = metadata.New(len(r.Header) + 8)
|
md = metadata.New(len(r.Header) + 8)
|
||||||
}
|
}
|
||||||
for k, v := range r.Header {
|
for k, v := range r.Header {
|
||||||
md.Set(k, strings.Join(v, ", "))
|
md[k] = strings.Join(v, ", ")
|
||||||
}
|
}
|
||||||
md.Set("RemoteAddr", r.RemoteAddr)
|
md["RemoteAddr"] = r.RemoteAddr
|
||||||
md.Set("Method", r.Method)
|
md["Method"] = r.Method
|
||||||
md.Set("URL", r.URL.String())
|
md["URL"] = r.URL.String()
|
||||||
md.Set("Proto", r.Proto)
|
md["Proto"] = r.Proto
|
||||||
md.Set("ContentLength", fmt.Sprintf("%d", r.ContentLength))
|
md["ContentLength"] = fmt.Sprintf("%d", r.ContentLength)
|
||||||
md.Set("TransferEncoding", strings.Join(r.TransferEncoding, ","))
|
md["TransferEncoding"] = strings.Join(r.TransferEncoding, ",")
|
||||||
md.Set("Host", r.Host)
|
md["Host"] = r.Host
|
||||||
md.Set("RequestURI", r.RequestURI)
|
md["RequestURI"] = r.RequestURI
|
||||||
ctx = metadata.NewIncomingContext(ctx, md)
|
ctx = metadata.NewIncomingContext(ctx, md)
|
||||||
|
|
||||||
defer r.Body.Close()
|
defer r.Body.Close()
|
||||||
|
Loading…
Reference in New Issue
Block a user