clone request

This commit is contained in:
Asim Aslam 2020-04-07 00:29:35 +01:00
parent b6348ba59a
commit 5374896ed0

View File

@ -92,7 +92,7 @@ func (h authHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
// set the endpoint in the context so it can be used to resolve
// the request later
ctx := context.WithValue(req.Context(), resolver.Endpoint{}, endpoint)
*req = *req.WithContext(ctx)
*req = *req.Clone(ctx)
}
// construct the resource name, e.g. home => go.micro.web.home