mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-15 10:47:49 -06:00
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:
parent
510d9822dd
commit
27902fe38f
5 changed files with 16 additions and 8 deletions
|
@ -6,10 +6,13 @@ from cura.API import Account
|
|||
from cura.CuraApplication import CuraApplication
|
||||
|
||||
|
||||
## Add a Authorization header to the request for Ultimaker Cloud Api requests.
|
||||
# When the user is not logged in or a token is not available, a warning will be logged
|
||||
# Also add the user agent headers (see DefaultUserAgentScope)
|
||||
class UltimakerCloudScope(DefaultUserAgentScope):
|
||||
"""Add an Authorization header to the request for Ultimaker Cloud Api requests.
|
||||
|
||||
When the user is not logged in or a token is not available, a warning will be logged
|
||||
Also add the user agent headers (see DefaultUserAgentScope)
|
||||
"""
|
||||
|
||||
def __init__(self, application: CuraApplication):
|
||||
super().__init__(application)
|
||||
api = application.getCuraAPI()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue