Base64 Problem

This commit is contained in:
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):
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
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}
return dict_item, 200
###
### correlation

View file

@ -305,7 +305,6 @@ def delete_item_tags():
@restApi.route("api/v1/get/item/content", methods=['POST'])
@token_required('read_only')
def get_item_content():
data = request.get_json()
item_id = data.get('id', None)
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'])
@token_required('read_only')
def get_item_content_text():
data = request.get_json()
item_id = data.get('id', None)
req_data = {'id': item_id}