1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-07 09:06:36 +02:00

[refactoring] replace direct use of curl with getContents (#3723)

+ some fixed warnings
This commit is contained in:
User123698745
2023-10-01 20:46:51 +02:00
committed by GitHub
parent 41df17bc46
commit 69da0dd583
6 changed files with 24 additions and 52 deletions

View File

@@ -52,7 +52,11 @@ function getContents(
$config['proxy'] = Configuration::getConfig('proxy', 'url');
}
$cacheKey = 'server_' . $url;
$requestBodyHash = null;
if (isset($curlOptions[CURLOPT_POSTFIELDS])) {
$requestBodyHash = md5(json_encode($curlOptions[CURLOPT_POSTFIELDS]));
}
$cacheKey = implode('_', ['server', $url, $requestBodyHash]);
/** @var Response $cachedResponse */
$cachedResponse = $cache->get($cacheKey);