Code Duplication    Length = 9-9 lines in 2 locations

lib/private/httphelper.php 1 location

@@ 62-70 (lines=9) @@
59
	 * If not, file_get_contents is used.
60
	 * @deprecated Use \OCP\Http\Client\IClientService
61
	 */
62
	public function getUrlContent($url) {
63
		try {
64
			$client = $this->clientService->newClient();
65
			$response = $client->get($url);
66
			return $response->getBody();
67
		} catch (\Exception $e) {
68
			return false;
69
		}
70
	}
71
72
	/**
73
	 * Returns the response headers of a HTTP URL without following redirects

lib/private/updater/versioncheck.php 1 location

@@ 123-131 (lines=9) @@
120
	 * @param string $url
121
	 * @return bool|resource|string
122
	 */
123
	protected function getUrlContent($url) {
124
		try {
125
			$client = $this->clientService->newClient();
126
			$response = $client->get($url);
127
			return $response->getBody();
128
		} catch (\Exception $e) {
129
			return false;
130
		}
131
	}
132
}
133
134