mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-08-17 08:30:33 +02:00
feat(network): add opt-in allow local/private network setting
Add a setting that relaxes the SSRF guard so extensions and built-in network code can reach private/local/loopback targets, for users routing traffic through a local proxy or custom DNS. Disabled by default. Wired end-to-end: Go backend (SetAllowPrivateNetwork toggles isPrivateIP guard), Android/iOS platform bridge, Dart settings model/provider, and a toggle in Download settings.
This commit is contained in:
@@ -125,6 +125,12 @@ class SettingsNotifier extends Notifier<AppSettings> {
|
||||
).catchError((Object e) {
|
||||
_log.w('Failed to sync network compatibility options to backend: $e');
|
||||
});
|
||||
|
||||
PlatformBridge.setAllowPrivateNetwork(state.allowLocalNetwork).catchError((
|
||||
Object e,
|
||||
) {
|
||||
_log.w('Failed to sync allow local network option to backend: $e');
|
||||
});
|
||||
}
|
||||
|
||||
void _syncExtensionFallbackSettingsToBackend() {
|
||||
@@ -575,6 +581,12 @@ class SettingsNotifier extends Notifier<AppSettings> {
|
||||
_syncNetworkCompatibilitySettingsToBackend();
|
||||
}
|
||||
|
||||
void setAllowLocalNetwork(bool enabled) {
|
||||
state = state.copyWith(allowLocalNetwork: enabled);
|
||||
_saveSettings();
|
||||
_syncNetworkCompatibilitySettingsToBackend();
|
||||
}
|
||||
|
||||
void setSongLinkRegion(String region) {
|
||||
final normalized = _normalizeSongLinkRegion(region);
|
||||
state = state.copyWith(songLinkRegion: normalized);
|
||||
|
||||
Reference in New Issue
Block a user