diff options
author | Ryan Schneider <ryanleeschneider@gmail.com> | 2018-06-02 18:26:47 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2018-06-02 18:26:47 +0800 |
commit | c8dcb9584e1ea77c9b967d2bec5d167c7df410f0 (patch) | |
tree | c33a8ce4d3aff367b26cae1e50df4b5199f23d52 /rpc/http.go | |
parent | af28d12847c4572c7c3d9f5775db9b18bcfc3889 (diff) | |
download | dexon-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)
Diffstat (limited to 'rpc/http.go')
-rw-r--r-- | rpc/http.go | 2 |
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) |