@@ -573,7 +573,7 @@ fn default_file_drop_enabled() -> bool {
573573
574574/// Security configuration.
575575#[ skip_serializing_none]
576- #[ derive( Debug , PartialEq , Clone , Deserialize , Serialize ) ]
576+ #[ derive( Debug , Default , PartialEq , Clone , Deserialize , Serialize ) ]
577577#[ cfg_attr( feature = "schema" , derive( JsonSchema ) ) ]
578578#[ serde( rename_all = "camelCase" , deny_unknown_fields) ]
579579pub struct SecurityConfig {
@@ -589,24 +589,10 @@ pub struct SecurityConfig {
589589 /// See <https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP>.
590590 pub dev_csp : Option < String > ,
591591 /// Freeze the `Object.prototype` when using the custom protocol.
592- #[ serde( default = "default_freeze_prototype" ) ]
592+ #[ serde( default ) ]
593593 pub freeze_prototype : bool ,
594594}
595595
596- impl Default for SecurityConfig {
597- fn default ( ) -> Self {
598- Self {
599- csp : None ,
600- dev_csp : None ,
601- freeze_prototype : default_freeze_prototype ( ) ,
602- }
603- }
604- }
605-
606- fn default_freeze_prototype ( ) -> bool {
607- true
608- }
609-
610596/// Defines an allowlist type.
611597pub trait Allowlist {
612598 /// Returns all features associated with the allowlist struct.
@@ -2558,7 +2544,7 @@ mod test {
25582544 security : SecurityConfig {
25592545 csp : None ,
25602546 dev_csp : None ,
2561- freeze_prototype : true ,
2547+ freeze_prototype : false ,
25622548 } ,
25632549 allowlist : AllowlistConfig :: default ( ) ,
25642550 system_tray : None ,
0 commit comments