feat: support alter response in teardown hooks

This commit is contained in:
debugtalk
2020-06-07 19:04:06 +08:00
parent 0b53f832f1
commit 45d1f3ed65
18 changed files with 54 additions and 32 deletions

View File

@@ -126,7 +126,7 @@ def setup_hook_httpntlmauth(request):
def alter_response(response):
response.status_code = 500
response.headers["Content-Type"] = "html/text"
response.json["headers"]["Host"] = "127.0.0.1:8888"
response.body["headers"]["Host"] = "127.0.0.1:8888"
response.new_attribute = "new_attribute_value"
response.new_attribute_dict = {"key": 123}