Fixes #5934 -- Explicitly specify port in Icecast relay URLs.
This commit is contained in:
parent
443534de7d
commit
86e8d565a4
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue