diff --git a/src/Middleware/Security.php b/src/Middleware/Security.php index 5007b02..6d2eabc 100644 --- a/src/Middleware/Security.php +++ b/src/Middleware/Security.php @@ -48,6 +48,7 @@ class Security '127.0.0.', '192.168.', '10.0.', + '172.19.' ])) { return true; } diff --git a/src/Server/JsonRpcServer.php b/src/Server/JsonRpcServer.php index 017fa7c..ebda98d 100644 --- a/src/Server/JsonRpcServer.php +++ b/src/Server/JsonRpcServer.php @@ -31,9 +31,9 @@ class JsonRpcServer extends JsonRpcBase public function handler() { - if ($this->request->getContentType() != 'json') { - return $this->error(self::Rpc_Error_Invalid_Request); - } +// if ($this->request->getContentType() != 'json') { +// return $this->error(self::Rpc_Error_Invalid_Request); +// } try { diff --git a/src/Server/JsonRpcTool.php b/src/Server/JsonRpcTool.php index afbbadb..258253d 100644 --- a/src/Server/JsonRpcTool.php +++ b/src/Server/JsonRpcTool.php @@ -35,12 +35,9 @@ class JsonRpcTool */ $view = view(); - $params = json_decode($request->input('params'), true); + $params = json_decode($request->input('params',"[\r\n]"), true); $method = $request->input('method'); if ($request->method() == Request::METHOD_POST) { - - - try { $result = app('rpc.'.$this->config['name'])->call($method, $params); $view->share('result', json_encode($result, JSON_PRETTY_PRINT)); @@ -52,7 +49,7 @@ class JsonRpcTool $view->share('method',$method); $view->share('endpoint', $this->getEndpoint()); $view->share('methods', $methods); - $view->share('params', json_encode($params)); + $view->share('params', json_encode($params,JSON_PRETTY_PRINT)); foreach ($methods as $name => $class) { $desc[$name] = $this->desc($class[0], $class[1]); diff --git a/src/views/tool.blade.php b/src/views/tool.blade.php index 5db66da..9f29510 100644 --- a/src/views/tool.blade.php +++ b/src/views/tool.blade.php @@ -68,9 +68,9 @@
- - + +
{{$params}}
+
@@ -99,6 +99,15 @@ + + \ No newline at end of file