spotube/lib/collections/http-override.dart
2025-07-05 21:46:35 +06:00

18 lines
434 B
Dart

import 'dart:io';
const allowList = [
"spotify.com",
];
class BadCertificateAllowlistOverrides extends HttpOverrides {
@override
HttpClient createHttpClient(SecurityContext? context) {
return super.createHttpClient(context)
..badCertificateCallback = (X509Certificate cert, String host, int port) {
return allowList.any((allowedHost) {
return host.endsWith(allowedHost);
});
};
}
}