From b05b36484b99825a39e328d8c28bfc566a8854cb Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 10 Oct 2024 12:52:28 -0400 Subject: [PATCH] Fix file staging in http api --- confluent_server/confluent/httpapi.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/confluent_server/confluent/httpapi.py b/confluent_server/confluent/httpapi.py index 0378fe5b..2cfbc117 100644 --- a/confluent_server/confluent/httpapi.py +++ b/confluent_server/confluent/httpapi.py @@ -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)