func (m requestTreeMiddleware) ProcessClientRequest(req mercury.Request) mercury.Request { if req.Headers()[parentIdHeader] == "" { // Don't overwrite an exiting header if parentId, ok := req.Context().Value(reqIdCtxKey).(string); ok && parentId != "" { req.SetHeader(parentIdHeader, parentId) } } // Pass through the current service and endpoint as the origin of this request req.SetHeader(originServiceHeader, CurrentServiceFor(req)) req.SetHeader(originEndpointHeader, CurrentEndpointFor(req)) return req }
func (m *testMw) ProcessClientRequest(req mercury.Request) mercury.Request { req.SetHeader("X-Foo", "X-Bar") return req }