From 8909b516ad874321c5d05681c19fdd201843ac28 Mon Sep 17 00:00:00 2001 From: dongwei <838456736@qq.com> Date: Sat, 19 Jan 2019 17:17:54 +0800 Subject: [PATCH] add header --- src/Client.php | 4 +--- src/Server/JsonRpcServer.php | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Client.php b/src/Client.php index e33c4ad..3510189 100644 --- a/src/Client.php +++ b/src/Client.php @@ -95,9 +95,7 @@ class Client try { $headers = [ - 'client_app' => $this->config['app'], - 'client_host' => gethostname(), - 'client_addr' => $_SERVER['SERVER_ADDR'], + 'x-client-app' => $this->config['app'], ]; app('rpc.logger')->info("client_request",array_merge($this->server_config, $payload)); $resp = $this->http->request('POST', 'rpc/json-rpc-v2.json', [ diff --git a/src/Server/JsonRpcServer.php b/src/Server/JsonRpcServer.php index 465a550..c1910bc 100644 --- a/src/Server/JsonRpcServer.php +++ b/src/Server/JsonRpcServer.php @@ -63,7 +63,7 @@ class JsonRpcServer return $this->error(self::Rpc_Error_Invalid_Params); } - app('rpc.logger')->info('server', [$id, $class,$method, $params, $this->request->header('client_app'), $this->request->header('client_addr'), $this->request->header('client_host')]); + app('rpc.logger')->info('server', [$id, $class,$method, $params, $this->request->header('x-client-app')]); $ret = call_user_func_array([(new $class($id, $this->request)), $function], $params); app('rpc.logger')->info('server_result', [$id, $ret]);