From 49865c86bf47bfe94f238578a31d397b1c6feb43 Mon Sep 17 00:00:00 2001 From: cle-b Date: Sat, 15 Nov 2025 14:04:39 +0100 Subject: [PATCH] stop printing the banner in case of export --- httpdbg/__init__.py | 2 +- httpdbg/__main__.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/httpdbg/__init__.py b/httpdbg/__init__.py index 1197b8a..ecd81b7 100644 --- a/httpdbg/__init__.py +++ b/httpdbg/__init__.py @@ -1,4 +1,4 @@ -__version__ = "2.1.3" +__version__ = "2.1.4" __all__ = ["export_html", "httprecord", "HTTPRecords"] diff --git a/httpdbg/__main__.py b/httpdbg/__main__.py index 25a1d5d..b8ed309 100644 --- a/httpdbg/__main__.py +++ b/httpdbg/__main__.py @@ -28,11 +28,6 @@ def pyhttpdbg( set_env_for_logging(params.log_level, params.log) - url = f"http://{params.host}:{params.port}/{'?hi=on' if params.console else ''}" - - if not params.no_banner: - print_msg(f" httpdbg - HTTP(S) requests available at {url}") - sys.path.insert(0, "") # to mimic the default python command behavior def run_recorder( @@ -58,6 +53,11 @@ def run_recorder( export_html(records, Path(params.export_html)) else: + url = f"http://{params.host}:{params.port}/{'?hi=on' if params.console else ''}" + + if not params.no_banner: + print_msg(f" httpdbg - HTTP(S) requests available at {url}") + with httpdbg_srv(params.host, params.port) as records: run_recorder(records, params.initiator, not params.only_client, test_mode)