Explorar el Código

Merge pull request #1914 from nicobleiler/v2-develop

Added check for response to the testConnectionOverseerr method
causefx hace 3 años
padre
commit
2722c3bc71
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      api/homepage/overseerr.php

+ 2 - 1
api/homepage/overseerr.php

@@ -69,7 +69,8 @@ trait OverseerrHomepageItem
 		try {
 			$options = $this->requestOptions($url, null, $this->config['overseerrDisableCertCheck'], $this->config['overseerrUseCustomCertificate']);
 			$test = Requests::get($url . "/api/v1/settings/main", $headers, $options);
-			if ($test->success) {
+			$testData = json_decode($test->body, true);
+			if ($test->success && isset($testData["apiKey"]) && $testData["apiKey"] == $this->config['overseerrToken']) {
 				$this->setAPIResponse('success', 'API Connection succeeded', 200);
 				return true;
 			} else {