Fixed minor bug

This commit is contained in:
Maxim Stewart 2020-05-11 15:49:58 -05:00
parent e82e80ad39
commit 3cd8fcea28
2 changed files with 6 additions and 7 deletions

View File

@ -188,8 +188,9 @@ def addNote():
text = request.values['entryText'].strip() text = request.values['entryText'].strip()
if request.method == 'POST' and text != '': if request.method == 'POST' and text != '':
try: try:
encodedStr = text encodedStr = text.strip()
decodedStr = base64.urlsafe_b64decode(encodedStr.encode('utf-8')).decode('utf-8') decodedStrPart = base64.urlsafe_b64decode(encodedStr.encode('utf-8')).decode('utf-8')
decodedStr = unquote(decodedStrPart)
notesListDecoded.append(decodedStr) notesListDecoded.append(decodedStr)
notesListEncoded.append(encodedStr) notesListEncoded.append(encodedStr)

View File

@ -83,11 +83,9 @@ const deleteAllTextAction = () => {
const createFormData = (entry) => { const createFormData = (entry) => {
let form = new FormData(); let form = new FormData();
for (var i = 0; i < entry.length; i++) { // Encoded special characters then encode to b64
// Encoded special characters then encode to b64 encodedStr = window.btoa(encodeURIComponent(entry))
encodedStr = window.btoa(encodeURIComponent(note)) form.append("entryText", encodedStr);
form.append("entryText", encodedStr);
}
return form; return form;
} }