ENV to change UA sent to outbound calls (Genius, Last.fm, LRCLIB)

This commit is contained in:
iamdoubz committed 2026-07-27 12:27:42 -05:00
1 parent 9993e9927f
commit 6180d2f638
3 files changed
+11 -2

No files matched your search

+2 -2
View File
@@ -51,7 +51,7 @@ function http_get($url, $timeout = 5, $headers = []) {
CURLOPT_TIMEOUT => (int) $timeout,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_MAXREDIRS => 3,
CURLOPT_USERAGENT => 'radio-site/1.0 (+https://github.com)',
CURLOPT_USERAGENT => cfg('runtime.user_agent'),
]);
if (!empty($headers)) {
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
@@ -67,7 +67,7 @@ function http_get($url, $timeout = 5, $headers = []) {
$ctx = stream_context_create([
'http' => [
'timeout' => (int) $timeout,
'header' => implode("\r\n", $headers),
'header' => implode("\r\n", array_merge(['User-Agent: ' . cfg('runtime.user_agent')], $headers)),
'ignore_errors' => true,
],
'ssl' => ['verify_peer' => true, 'verify_peer_name' => true],