Fix an utf8 error in auth code

This commit is contained in:
Julien Duponchelle 2017-03-27 10:38:41 +02:00
parent 80e361ff2e
commit ac05db5d1b
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8

View File

@ -21,7 +21,6 @@ import urllib
import asyncio
import aiohttp
import logging
import urllib
import traceback
import jsonschema
@ -114,7 +113,7 @@ class Route(object):
return
if "AUTHORIZATION" in request.headers:
if request.headers["AUTHORIZATION"] == aiohttp.helpers.BasicAuth(user, password).encode():
if request.headers["AUTHORIZATION"] == aiohttp.helpers.BasicAuth(user, password, "utf-8").encode():
return
log.error("Invalid auth. Username should %s", user)