mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-08 17:40:28 +00:00
feat(http): add option to skip SSL certificate verification (#801)
This commit is contained in:
1 parent
3384f5197a
commit
2523282a89
19 files changed
+48
-1
No files matched your search
@@ -8,12 +8,14 @@ class Request {
|
||||
Object? extra;
|
||||
Map<String, String>? labels = {};
|
||||
RequestProxy? proxy;
|
||||
bool skipVerifyCert = false;
|
||||
|
||||
Request({
|
||||
required this.url,
|
||||
this.extra,
|
||||
this.labels,
|
||||
this.proxy,
|
||||
this.skipVerifyCert = false,
|
||||
});
|
||||
|
||||
factory Request.fromJson(Map<String, dynamic> json) =>
|
||||
|
||||
@@ -15,6 +15,7 @@ Request _$RequestFromJson(Map<String, dynamic> json) => Request(
|
||||
proxy: json['proxy'] == null
|
||||
? null
|
||||
: RequestProxy.fromJson(json['proxy'] as Map<String, dynamic>),
|
||||
skipVerifyCert: json['skipVerifyCert'] as bool? ?? false,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$RequestToJson(Request instance) {
|
||||
@@ -31,6 +32,7 @@ Map<String, dynamic> _$RequestToJson(Request instance) {
|
||||
writeNotNull('extra', instance.extra);
|
||||
writeNotNull('labels', instance.labels);
|
||||
writeNotNull('proxy', instance.proxy?.toJson());
|
||||
val['skipVerifyCert'] = instance.skipVerifyCert;
|
||||
return val;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user