fix unittests

This commit is contained in:
Martin Zimmermann 2013-12-01 13:38:41 +01:00
parent 32e4b70510
commit 4c16ba76cc
2 changed files with 2 additions and 1 deletions

View File

@ -44,7 +44,7 @@ def csrf(view):
def dec(self, environ, request, *args, **kwargs):
origin = request.headers.get("Origin")
origin = request.headers.get("Origin", "")
if parse.host(origin) not in map(parse.host, self.conf.getiter("host")):
raise Forbidden("CSRF")

View File

@ -11,6 +11,7 @@ class FakeIP(object):
def __call__(self, environ, start_response):
environ['REMOTE_ADDR'] = self.ip
environ['HTTP_ORIGIN'] = "http://localhost:8080"
return self.app(environ, start_response)