2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-25 02:52:07 +00:00

Fix file staging in http api

This commit is contained in:
Jarrod Johnson 2024-10-10 12:52:28 -04:00
parent 3a0218c421
commit b05b36484b

View File

@ -45,6 +45,7 @@ import eventlet
import eventlet.greenthread
import greenlet
import json
import os
import socket
import sys
import traceback
@ -981,7 +982,9 @@ def resourcehandler_backend(env, start_response):
start_response('401 Unauthorized', headers)
yield json.dumps({'data': 'You do not have permission to write to file'})
return
elif 'application/json' in reqtype and (len(url.split('/')) == 2):
elif len(url.split('/')) == 2:
reqbody = env['wsgi.input'].read(int(env['CONTENT_LENGTH']))
reqtype = env['CONTENT_TYPE']
if not isinstance(reqbody, str):
reqbody = reqbody.decode('utf8')
pbody = json.loads(reqbody)