fix unittests
This commit is contained in:
parent
32e4b70510
commit
4c16ba76cc
@ -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")
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user