diff --git a/lib/Service/CallService.php b/lib/Service/CallService.php index b86d184..68e4003 100644 --- a/lib/Service/CallService.php +++ b/lib/Service/CallService.php @@ -249,6 +249,8 @@ public function call( $time_end = microtime(true); + $body = $response->getBody()->getContents(); + // Let create the data array $data = [ 'request' => [ @@ -263,7 +265,7 @@ public function call( 'size' => $response->getBody()->getSize(), 'remoteIp' => $response->getHeaderLine('X-Real-IP') ?: $response->getHeaderLine('X-Forwarded-For') ?: null, 'headers' => $response->getHeaders(), - 'body' => $response->getBody()->getContents(), + 'body' => mb_check_encoding(value: $body, encoding: 'UTF-8') !== false ? $body : base64_encode($body), ] ]; diff --git a/lib/Settings/OpenConnectorAdmin.php b/lib/Settings/OpenConnectorAdmin.php index e69de29..4e35c3f 100644 --- a/lib/Settings/OpenConnectorAdmin.php +++ b/lib/Settings/OpenConnectorAdmin.php @@ -0,0 +1,43 @@ +config = $config; + $this->l = $l; + } + + /** + * @return TemplateResponse + */ + public function getForm() { + $parameters = [ + 'mySetting' => $this->config->getSystemValue('open_connector_setting', true), + ]; + + return new TemplateResponse('openconnector', 'settings/admin', $parameters, ''); + } + + public function getSection() { + return 'openconnector'; // Name of the previously created section. + } + + /** + * @return int whether the form should be rather on the top or bottom of + * the admin section. The forms are arranged in ascending order of the + * priority values. It is required to return a value between 0 and 100. + * + * E.g.: 70 + */ + public function getPriority() { + return 10; + } +}