2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-03-19 01:47:45 +00:00

Protect against binary sealed data

It was detected that binary sealed data
could happen. Ensure that it is str
before passing to configuration.
This commit is contained in:
Jarrod Johnson 2021-04-23 14:17:54 -04:00
parent affbbcc89b
commit f584b9bc11

View File

@ -259,6 +259,8 @@ def handle_request(env, start_response):
start_response('500 Error', (('Content-Type', 'text/plain'),))
yield 'No pending profile detected, unable to accept status update'
elif env['PATH_INFO'] == '/self/saveapikey' and reqbody:
if not isinstance(reqbody, str):
reqbody = reqbody.decode('utf8')
cfg.set_node_attributes({
nodename: {'deployment.sealedapikey': {'value': reqbody}}})
start_response('200 OK', ())