aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Schneider <ryanleeschneider@gmail.com>2018-06-02 18:26:47 +0800
committerFelix Lange <fjl@users.noreply.github.com>2018-06-02 18:26:47 +0800
commitc8dcb9584e1ea77c9b967d2bec5d167c7df410f0 (patch)
treec33a8ce4d3aff367b26cae1e50df4b5199f23d52
parentaf28d12847c4572c7c3d9f5775db9b18bcfc3889 (diff)
downloaddexon-c8dcb9584e1ea77c9b967d2bec5d167c7df410f0.tar
dexon-c8dcb9584e1ea77c9b967d2bec5d167c7df410f0.tar.gz
dexon-c8dcb9584e1ea77c9b967d2bec5d167c7df410f0.tar.bz2
dexon-c8dcb9584e1ea77c9b967d2bec5d167c7df410f0.tar.lz
dexon-c8dcb9584e1ea77c9b967d2bec5d167c7df410f0.tar.xz
dexon-c8dcb9584e1ea77c9b967d2bec5d167c7df410f0.tar.zst
dexon-c8dcb9584e1ea77c9b967d2bec5d167c7df410f0.zip
rpc: use HTTP request context as top-level context (#16861)
-rw-r--r--rpc/http.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/rpc/http.go b/rpc/http.go
index feaa7348c..fe5e4b309 100644
--- a/rpc/http.go
+++ b/rpc/http.go
@@ -181,7 +181,7 @@ func (srv *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
// All checks passed, create a codec that reads direct from the request body
// untilEOF and writes the response to w and order the server to process a
// single request.
- ctx := context.Background()
+ ctx := r.Context()
ctx = context.WithValue(ctx, "remote", r.RemoteAddr)
ctx = context.WithValue(ctx, "scheme", r.Proto)
ctx = context.WithValue(ctx, "local", r.Host)