Fixes #5934 -- Explicitly specify port in Icecast relay URLs.

This commit is contained in:
Buster Neece 2022-12-15 17:37:09 -06:00
parent 443534de7d
commit 86e8d565a4
No known key found for this signature in database
GPG Key ID: F1D2E64A0005E80E
2 changed files with 15 additions and 3 deletions

View File

@ -240,10 +240,22 @@ class StationMount implements
public function getRelayUrlAsUri(): ?UriInterface
{
return Urls::tryParseUserUrl(
$relayUri = Urls::tryParseUserUrl(
$this->relay_url,
'Mount Point ' . $this->__toString() . ' Relay URL'
);
if (null !== $relayUri) {
// Relays need port explicitly provided.
$port = $relayUri->getPort();
if ($port === null && '' !== $relayUri->getScheme()) {
$relayUri = $relayUri->withPort(
('https' === $relayUri->getScheme()) ? 443 : 80
);
}
}
return $relayUri;
}
public function setRelayUrl(?string $relay_url = null): void

View File

@ -234,12 +234,12 @@ final class Icecast extends AbstractFrontend
$mountRelayUri = $mount_row->getRelayUrlAsUri();
if (null !== $mountRelayUri) {
$config['relay'][] = [
$config['relay'][] = array_filter([
'server' => $mountRelayUri->getHost(),
'port' => $mountRelayUri->getPort(),
'mount' => $mountRelayUri->getPath(),
'local-mount' => $mount_row->getName(),
];
]);
}
if ($useListenerAuth) {