diff options
Diffstat (limited to 'rpc')
-rw-r--r-- | rpc/http.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/rpc/http.go b/rpc/http.go index 9e4f2b261..af79858e2 100644 --- a/rpc/http.go +++ b/rpc/http.go @@ -238,6 +238,12 @@ func (srv *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { ctx = context.WithValue(ctx, "remote", r.RemoteAddr) ctx = context.WithValue(ctx, "scheme", r.Proto) ctx = context.WithValue(ctx, "local", r.Host) + if ua := r.Header.Get("User-Agent"); ua != "" { + ctx = context.WithValue(ctx, "User-Agent", ua) + } + if origin := r.Header.Get("Origin"); origin != "" { + ctx = context.WithValue(ctx, "Origin", origin) + } body := io.LimitReader(r.Body, maxRequestContentLength) codec := NewJSONCodec(&httpReadWriteNopCloser{body, w}) |