mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-12 23:45:18 +00:00
18 lines
434 B
Dart
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);
|
|
});
|
|
};
|
|
}
|
|
}
|