charlesthomas / magpie

Git-backed Evernote replacement
MIT License
645 stars 50 forks source link

400 errors caused by bad characters pasted in to textarea. #57

Closed KDocProf closed 9 years ago

KDocProf commented 10 years ago

Maybe this problem is unique to my system. My 'server' is a first generation AppleTV running Debian wheezy. But I've had several problems getting 400 errors during save operations after pasting in content from external sources. There's probably a better solution available, but here's how I solved it on my system:

First, I copied ununicode.py to the 'handler/' directory.

Next , I added an import statement at line 10 of 'handler/note.py':

10 from base import BaseHandler
11 import ununicode

Then I added this at line 54 of 'handler/note.py':

if not confirmed:
 53             note_contents = open(path).read()
 54             note_contents = ununicode.toascii(note_contents)
 55             self.render('note.html', notebook_name=notebook_name,

This solved the problem for me.