Hi

I'm not sure if this is a mod_wsgi issue or a misconfiguration but I'm 
running out of ideas so I thought I ask here.
When I post data to an endpoint of my flask application it seems that 
unicode characters (umlauts in this case) are being escaped with \\, which 
makes the data unusable.

The code:
@app.route('/', methods=['POST'])
def handle_post():
    raw_data = request.get_data()
    data = request.get_json()
    app.logger.debug('%s\n%s', raw_data, data)
    return str(data)

The command I use:
curl -X POST -H 'Content-type: application/json' -d '{"text":"test 123 
äöü"}' 127.0.0.1:3080

wsgi file:
WSGIDaemonProcess wsgi-app user=www-data group=www-data threads=5        
WSGIScriptAlias / /var/www/wsgi-app/app.wsgi

<Directory /home/marcus/app>
    WSGIProcessGroup wsgi-app
    WSGIApplicationGroup %{GLOBAL}
    Order deny,allow
    Allow from all
</Directory>

Log output:
[Sat Jul 01 12:38:22.863316 2017] [wsgi:error] [pid 12045] b'{"text":"test 
123 \\xc3\\xa4\\xc3\\xb6\\xc3\\xbc"}'
[Sat Jul 01 12:38:22.863319 2017] [wsgi:error] [pid 12045] {'text': 'test 
123 \xc3\xa4\xc3\xb6\xc3\xbc'}

Environment:
Ubuntu Server 16.04 LTS, Apache/2.4.18 (Ubuntu) mod_wsgi/4.3.0 Python/3.5.2


Any ideas what the problem could be?

Marcus

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to