create outgoing metadata automatic on request

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2024-12-04 11:33:11 +03:00
parent dace6eef67
commit 7ec7aadfbf

View File

@ -382,6 +382,7 @@ func (h *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
md["Host"] = r.Host
md["RequestURI"] = r.RequestURI
ctx = metadata.NewIncomingContext(ctx, md)
ctx = metadata.NewOutgoingContext(ctx, metadata.New(0))
path := r.URL.Path
if !strings.HasPrefix(path, "/") {