Base64 Problem

pull/586/head
TonyJabbour 2021-10-04 15:54:57 +02:00
parent bc8df8e671
commit 7fb796172c
2 changed files with 1 additions and 26 deletions

View File

@ -222,9 +222,6 @@ def get_item(request_dict):
# API as txt
def get_item_as_txt(request_dict): def get_item_as_txt(request_dict):
item_id = request_dict.get('id', None) item_id = request_dict.get('id', None)
@ -236,32 +233,12 @@ def get_item_as_txt(request_dict):
return {'status': 'error', 'reason': 'Item not found'}, 404 return {'status': 'error', 'reason': 'Item not found'}, 404
item_content = get_item_content(item_id) item_content = get_item_content(item_id)
base64_output = base64.b64encode(item_content.encode()) base64_output = base64.b64encode((item_content.encode('utf-8')).decode())
dict_item = {'id': item_id, 'content': base64_output} dict_item = {'id': item_id, 'content': base64_output}
return dict_item, 200 return dict_item, 200
### ###
### correlation ### correlation

View File

@ -305,7 +305,6 @@ def delete_item_tags():
@restApi.route("api/v1/get/item/content", methods=['POST']) @restApi.route("api/v1/get/item/content", methods=['POST'])
@token_required('read_only') @token_required('read_only')
def get_item_content(): def get_item_content():
data = request.get_json() data = request.get_json()
item_id = data.get('id', None) item_id = data.get('id', None)
req_data = {'id': item_id, 'date': False, 'content': True, 'tags': False} req_data = {'id': item_id, 'date': False, 'content': True, 'tags': False}
@ -316,7 +315,6 @@ def get_item_content():
@restApi.route("api/v1/get/item/content/text", methods=['POST']) @restApi.route("api/v1/get/item/content/text", methods=['POST'])
@token_required('read_only') @token_required('read_only')
def get_item_content_text(): def get_item_content_text():
data = request.get_json() data = request.get_json()
item_id = data.get('id', None) item_id = data.get('id', None)
req_data = {'id': item_id} req_data = {'id': item_id}