From 1d75e96d4e230f23b56cb195276661e3d0134231 Mon Sep 17 00:00:00 2001 From: debugtalk Date: Mon, 29 Jun 2020 18:24:24 +0800 Subject: [PATCH] fix: mishandling of request header `Content-Length` for GET method --- docs/CHANGELOG.md | 1 + httprunner/models.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 3206dd26..164235e0 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -6,6 +6,7 @@ - fix: missing setup/teardown hooks for referenced testcase - fix: compatibility for `black` on Android termux that does not support multiprocessing well +- fix: mishandling of request header `Content-Length` for GET method **Changed** diff --git a/httprunner/models.py b/httprunner/models.py index 775a7a75..51264c33 100644 --- a/httprunner/models.py +++ b/httprunner/models.py @@ -51,8 +51,8 @@ class TRequest(BaseModel): url: Url params: Dict[Text, Text] = {} headers: Headers = {} - req_json: Union[Dict, List] = Field({}, alias="json") - data: Union[Text, Dict[Text, Any]] = "" + req_json: Union[Dict, List] = Field(None, alias="json") + data: Union[Text, Dict[Text, Any]] = None cookies: Cookies = {} timeout: float = 120 allow_redirects: bool = True