1111 ██║ ██║ ██║ ╚██████╔╝██║ ╚████║╚██████╗███████╗██████╔╝███████╗███████╗
1212 ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝╚══════╝╚═════╝ ╚══════╝╚══════╝
1313
14- Provides the configuration comparision interface.
14+ Provides the configuration comparison interface.
1515
1616Author:
1717 Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom
@@ -175,7 +175,7 @@ class ConfigComparison:
175175 }
176176
177177 _local_config : dict = {}
178- _upsteam_config : dict = {}
178+ _upstream_config : dict = {}
179179
180180 dict_helper : DictHelper = DictHelper ()
181181
@@ -228,12 +228,12 @@ def upstream_config(self) -> dict:
228228 Provides the current state of the :code:`_upstream_config`.
229229 """
230230
231- return self ._upsteam_config
231+ return self ._upstream_config
232232
233233 @upstream_config .setter
234234 def upstream_config (self , value : dict ) -> None :
235235 """
236- Sets the upstram configuration to work with.
236+ Sets the upstream configuration to work with.
237237
238238 :raise TypeError:
239239 When :code:`value` is not a :py:class:`dict`
@@ -242,11 +242,11 @@ def upstream_config(self, value: dict) -> None:
242242 if not isinstance (value , dict ):
243243 raise TypeError (f"<value> should be { dict } , { type (value )} given." )
244244
245- self ._upsteam_config = copy .deepcopy (value )
245+ self ._upstream_config = copy .deepcopy (value )
246246
247247 def set_upstream_config (self , value : dict ) -> "ConfigComparison" :
248248 """
249- Sets the upstram configuration to work with.
249+ Sets the upstream configuration to work with.
250250 """
251251
252252 self .upstream_config = value
@@ -265,6 +265,7 @@ def is_local_identical(self) -> bool:
265265 )
266266 or "user_agent" not in self .local_config
267267 or not isinstance (self .local_config ["user_agent" ], dict )
268+ or "http_codes" not in self .local_config
268269 or "active" in self .local_config ["http_codes" ]
269270 or "not_found_default" in self .local_config ["http_codes" ]
270271 or "self_managed" not in self .local_config ["http_codes" ]
@@ -281,7 +282,7 @@ def is_local_identical(self) -> bool:
281282 if index in self .DELETED_CORE :
282283 return False
283284
284- for index in self .local_config [ "links" ] :
285+ for index in self .local_config . get ( "links" , {}) :
285286 if index in self .DELETED_LINKS :
286287 return False
287288
@@ -369,10 +370,10 @@ def get_merged(self) -> dict:
369370 del merged [index ]
370371
371372 for index in self .DELETED_LINKS :
372- if index in merged [ "links" ] :
373+ if index in merged . get ( "links" , {}) :
373374 del merged ["links" ][index ]
374375
375- if not bool (merged ["http_codes" ]["self_managed" ]):
376+ if "http_codes" in merged and not bool (merged ["http_codes" ]["self_managed" ]):
376377 for index , values in PyFunceble .storage .STD_HTTP_CODES .list .items ():
377378 merged ["http_codes" ]["list" ][index ] = list (values )
378379
0 commit comments