fix tests

This commit is contained in:
Maximilian Hils 2014-12-01 03:36:04 +01:00
parent 40fbb95701
commit a7a9ef826c
2 changed files with 17 additions and 9 deletions

View File

@ -14,9 +14,16 @@ from libmproxy.protocol.tcp import TCPHandler
from libmproxy.protocol import KILL
from libmproxy.script import concurrent
def start(context, argv):
HTTPRequest._headers_to_strip_off.remove("Connection")
HTTPRequest._headers_to_strip_off.remove("Upgrade")
def done(context):
HTTPRequest._headers_to_strip_off.append("Connection")
HTTPRequest._headers_to_strip_off.append("Upgrade")
@concurrent
def response(context, flow):
if flow.response.headers.get_first("Connection", None) == "Upgrade":

View File

@ -16,4 +16,5 @@ def test_load_scripts():
f += " foo" # one argument required
if "modify_response_body" in f:
f += " foo bar" # two arguments required
script.Script(f, tmaster) # Loads the script file.
s = script.Script(f, tmaster) # Loads the script file.
s.unload()