Skip to content

Commit 87e2d13

Browse files
committed
do not create group if httpdbg web server
1 parent ec44697 commit 87e2d13

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

httpdbg/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
from httpdbg.records import HTTPRecords
44

55

6-
__version__ = "1.1.0"
6+
__version__ = "1.1.1"
77

88
__all__ = ["httprecord", "HTTPRecords"]

httpdbg/hooks/http.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,17 @@
1111

1212

1313
def set_hook_for_http_server_handle_one_request(records: HTTPRecords, method: Callable):
14-
def hook(*args, **kwargs):
14+
15+
def hook(self, *args, **kwargs):
16+
from httpdbg.webapp.app import HttpbgHTTPRequestHandler
1517

1618
# the group label/full_label will be updated when the endpoint method will be called
17-
with httpdbg_group(records, "one request", ""):
18-
ret = method(*args, **kwargs)
19+
if not isinstance(self, HttpbgHTTPRequestHandler):
20+
with httpdbg_group(records, "one request", ""):
21+
ret = method(self, *args, **kwargs)
22+
else:
23+
# this request is due to the httpdbg web server itself, we can ignore it
24+
ret = method(self, *args, **kwargs)
1925

2026
return ret
2127

0 commit comments

Comments
 (0)