From 832937de9730a99bc87dfe628e36b73fdaadab67 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 30 Aug 2019 17:35:32 +0100 Subject: [PATCH] Encode string as bytes --- daemon.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/daemon.py b/daemon.py index e6be2809..870b2105 100644 --- a/daemon.py +++ b/daemon.py @@ -1831,8 +1831,8 @@ class PubServer(BaseHTTPRequestHandler): } for mType,extensionList in mediaTypes.items(): for extension in extensionList: - searchStr=b'Content-Type: '+mType+'/'+extension - imageLocation=postBytes.find(searchStr) + searchStr='Content-Type: '+mType+'/'+extension + imageLocation=postBytes.find(searchStr.encode('utf-8')) filenameBase=self.server.baseDir+'/accounts/'+nickname+'@'+self.server.domain+'/upload' if imageLocation>-1: if extension=='jpeg':