Use JsonDecorator scope in the Toolbox and CloudSync

Improves security by disallowing other content than json for requests

CURA-7150
This commit is contained in:
Nino van Hooff 2020-02-25 14:41:02 +01:00
parent 510d9822dd
commit 27902fe38f
5 changed files with 16 additions and 8 deletions

View file

@ -1,5 +1,6 @@
from UM.Logger import Logger
from UM.TaskManagement.HttpRequestManager import HttpRequestManager
from UM.TaskManagement.HttpRequestScope import JsonDecoratorScope
from cura.CuraApplication import CuraApplication
from ..CloudApiModel import CloudApiModel
from ..UltimakerCloudScope import UltimakerCloudScope
@ -26,7 +27,7 @@ class CloudApiClient:
if self.__instance is not None:
raise RuntimeError("This is a Singleton. use getInstance()")
self._scope = UltimakerCloudScope(app) # type: UltimakerCloudScope
self._scope = JsonDecoratorScope(UltimakerCloudScope(app)) # type: JsonDecoratorScope
app.getPackageManager().packageInstalled.connect(self._onPackageInstalled)