mirror of
https://github.com/spalencsar/bearwave.git
synced 2026-07-06 14:24:14 +02:00
release: 1.0.4 security hardening and stability fixes
Validate manual stream URLs (http/https only), restrict notification cover downloads to HTTPS, and add transfer timeouts for metadata and cover fetches. Document playback, tray, MPRIS, and QML refactor changes in CHANGELOG and AppStream metadata.
This commit is contained in:
@@ -29,6 +29,8 @@ private slots:
|
||||
void cached_load_keeps_error_clear_after_network_failure();
|
||||
void list_reload_resyncs_index_for_playing_station();
|
||||
void list_next_disabled_when_playing_station_not_in_new_list();
|
||||
void manual_station_rejects_unsafe_url_scheme();
|
||||
void manual_station_accepts_http_and_https();
|
||||
};
|
||||
|
||||
namespace {
|
||||
@@ -302,5 +304,29 @@ void RadioBackendPlaybackTest::list_next_disabled_when_playing_station_not_in_ne
|
||||
QCOMPARE(backend.currentStationUrl(), topUrl);
|
||||
}
|
||||
|
||||
void RadioBackendPlaybackTest::manual_station_rejects_unsafe_url_scheme()
|
||||
{
|
||||
RadioBackend backend;
|
||||
|
||||
backend.addManualStation(QStringLiteral("Unsafe"), QStringLiteral("file:///etc/passwd"), QStringLiteral("DE"));
|
||||
QCOMPARE(backend.stations().size(), 0);
|
||||
QVERIFY(!backend.lastError().isEmpty());
|
||||
|
||||
backend.addManualStation(QStringLiteral("FTP"), QStringLiteral("ftp://example.com/stream"), QStringLiteral("DE"));
|
||||
QCOMPARE(backend.stations().size(), 0);
|
||||
}
|
||||
|
||||
void RadioBackendPlaybackTest::manual_station_accepts_http_and_https()
|
||||
{
|
||||
RadioBackend backend;
|
||||
|
||||
backend.addManualStation(QStringLiteral("HTTP"), QStringLiteral("http://example.com/stream"), QStringLiteral("DE"));
|
||||
QCOMPARE(backend.stations().size(), 1);
|
||||
QCOMPARE(backend.lastError(), QString());
|
||||
|
||||
backend.addManualStation(QStringLiteral("HTTPS"), QStringLiteral("https://example.com/stream"), QStringLiteral("DE"));
|
||||
QCOMPARE(backend.stations().size(), 2);
|
||||
}
|
||||
|
||||
QTEST_MAIN(RadioBackendPlaybackTest)
|
||||
#include "radiobackend_playback_test.moc"
|
||||
Reference in New Issue
Block a user