httpdbg 0.24.2__tar.gz → 0.26.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. {httpdbg-0.24.2 → httpdbg-0.26.0}/PKG-INFO +1 -1
  2. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/__init__.py +1 -1
  3. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/mode_script.py +1 -1
  4. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/webapp/static/api.js +7 -12
  5. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/webapp/static/filter.js +23 -13
  6. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/webapp/static/index.htm +6 -4
  7. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/webapp/static/render.js +1 -0
  8. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/webapp/static/table.css +1 -0
  9. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg.egg-info/PKG-INFO +1 -1
  10. {httpdbg-0.24.2 → httpdbg-0.26.0}/LICENSE +0 -0
  11. {httpdbg-0.24.2 → httpdbg-0.26.0}/README.md +0 -0
  12. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/__main__.py +0 -0
  13. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/args.py +0 -0
  14. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/env.py +0 -0
  15. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/exception.py +0 -0
  16. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/hooks/__init__.py +0 -0
  17. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/hooks/aiohttp.py +0 -0
  18. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/hooks/all.py +0 -0
  19. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/hooks/external.py +0 -0
  20. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/hooks/generic.py +0 -0
  21. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/hooks/httpx.py +0 -0
  22. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/hooks/pytest.py +0 -0
  23. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/hooks/requests.py +0 -0
  24. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/hooks/socket.py +0 -0
  25. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/hooks/urllib3.py +0 -0
  26. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/hooks/utils.py +0 -0
  27. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/initiator.py +0 -0
  28. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/mode_console.py +0 -0
  29. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/mode_module.py +0 -0
  30. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/preview.py +0 -0
  31. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/records.py +0 -0
  32. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/server.py +0 -0
  33. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/utils.py +0 -0
  34. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/webapp/__init__.py +0 -0
  35. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/webapp/api.py +0 -0
  36. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/webapp/app.py +0 -0
  37. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/webapp/static/column.css +0 -0
  38. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/webapp/static/configuration.js +0 -0
  39. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/webapp/static/detail.css +0 -0
  40. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/webapp/static/favicon.ico +0 -0
  41. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/webapp/static/icons/chevron-direction-top-outline-icon.svg +0 -0
  42. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/webapp/static/icons/download-install-line-icon.svg +0 -0
  43. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/webapp/static/icons/engine-gears-icon.svg +0 -0
  44. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/webapp/static/icons/files-papers-outline-icon.svg +0 -0
  45. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/webapp/static/icons/filter-outline-icon.svg +0 -0
  46. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/webapp/static/icons/information-mark-circle-outline-icon.svg +0 -0
  47. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/webapp/static/icons/math-multiplication-icon.svg +0 -0
  48. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/webapp/static/icons/push-pin-green-icon.svg +0 -0
  49. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/webapp/static/icons/question-mark-round-line-icon.svg +0 -0
  50. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/webapp/static/icons/recycle-bin-line-icon.svg +0 -0
  51. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/webapp/static/icons/wait-sandclock-icon.svg +0 -0
  52. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/webapp/static/main.js +0 -0
  53. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/webapp/static/mustache.min.js +0 -0
  54. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg/webapp/static/style.css +0 -0
  55. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg.egg-info/SOURCES.txt +0 -0
  56. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg.egg-info/dependency_links.txt +0 -0
  57. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg.egg-info/entry_points.txt +0 -0
  58. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg.egg-info/requires.txt +0 -0
  59. {httpdbg-0.24.2 → httpdbg-0.26.0}/httpdbg.egg-info/top_level.txt +0 -0
  60. {httpdbg-0.24.2 → httpdbg-0.26.0}/pyproject.toml +0 -0
  61. {httpdbg-0.24.2 → httpdbg-0.26.0}/setup.cfg +0 -0
  62. {httpdbg-0.24.2 → httpdbg-0.26.0}/tests/test_api.py +0 -0
  63. {httpdbg-0.24.2 → httpdbg-0.26.0}/tests/test_cli.py +0 -0
  64. {httpdbg-0.24.2 → httpdbg-0.26.0}/tests/test_context_manager.py +0 -0
  65. {httpdbg-0.24.2 → httpdbg-0.26.0}/tests/test_hook_aiohttp.py +0 -0
  66. {httpdbg-0.24.2 → httpdbg-0.26.0}/tests/test_hook_httpx.py +0 -0
  67. {httpdbg-0.24.2 → httpdbg-0.26.0}/tests/test_hook_requests.py +0 -0
  68. {httpdbg-0.24.2 → httpdbg-0.26.0}/tests/test_hook_urllib3.py +0 -0
  69. {httpdbg-0.24.2 → httpdbg-0.26.0}/tests/test_initiator.py +0 -0
  70. {httpdbg-0.24.2 → httpdbg-0.26.0}/tests/test_mode_console.py +0 -0
  71. {httpdbg-0.24.2 → httpdbg-0.26.0}/tests/test_mode_module_pytest.py +0 -0
  72. {httpdbg-0.24.2 → httpdbg-0.26.0}/tests/test_mode_script.py +0 -0
  73. {httpdbg-0.24.2 → httpdbg-0.26.0}/tests/test_preview.py +0 -0
  74. {httpdbg-0.24.2 → httpdbg-0.26.0}/tests/test_server.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: httpdbg
3
- Version: 0.24.2
3
+ Version: 0.26.0
4
4
  Summary: A very simple tool to debug HTTP(S) client requests
5
5
  Author-email: cle-b <cle@tictac.pm>
6
6
  License: Apache-2.0
@@ -3,6 +3,6 @@ from httpdbg.hooks.all import httprecord
3
3
  from httpdbg.records import HTTPRecords
4
4
 
5
5
 
6
- __version__ = "0.24.2"
6
+ __version__ = "0.26.0"
7
7
 
8
8
  __all__ = ["httprecord", "HTTPRecords"]
@@ -10,7 +10,7 @@ def run_script(argv: List[str]) -> None:
10
10
  if len(argv) == 0:
11
11
  exit("script mode - error - python file required, but none set")
12
12
  try:
13
- spec = importlib.util.spec_from_file_location("torun", argv[0]) # type: ignore
13
+ spec = importlib.util.spec_from_file_location("__main__", argv[0]) # type: ignore
14
14
  module = importlib.util.module_from_spec(spec) # type: ignore
15
15
  except AttributeError:
16
16
  exit("script mode - error - the first argument shall be a python file")
@@ -13,7 +13,11 @@ function save_request(request_id, request) {
13
13
  if (request.pin == undefined) {
14
14
  request.pin = "";
15
15
  }
16
+ if (request.filter == undefined) {
17
+ request.filter = "---";
18
+ }
16
19
  global.requests[request_id] = request;
20
+
17
21
  if (global.requests[request_id].in_progress) {
18
22
  global.requests[request_id].status_code_view = '<img class="icon" src="static/icons/wait-sandclock-icon.svg-+-$**HTTPDBG_VERSION**$" alt="loading"/>';
19
23
  } else {
@@ -29,12 +33,6 @@ function save_request(request_id, request) {
29
33
  break;
30
34
  }
31
35
  }
32
- global.requests[request_id].request = global.requests[request_id].request || {
33
- "for_filter": ""
34
- }
35
- global.requests[request_id].response = global.requests[request_id].response || {
36
- "for_filter": ""
37
- }
38
36
 
39
37
  if (!request.pin) {
40
38
  get_request(request_id);
@@ -88,29 +86,26 @@ async function get_request(request_id) {
88
86
  .then(res => res.json())
89
87
  .then(data => {
90
88
  global.connected = true;
89
+ global.requests[request_id].filter = prepare_for_filter(global.requests[request_id].url);
91
90
 
92
91
  global.requests[request_id].request = data.request;
93
92
  if (data.request.body && data.request.body.text) {
94
- global.requests[request_id].request.for_filter = prepare_for_filter(
93
+ global.requests[request_id].filter += " " + prepare_for_filter(
95
94
  parse_raw_text(
96
95
  data.request.body.text,
97
96
  data.request.body.content_type
98
97
  ) || data.request.body.text
99
98
  );
100
- } else {
101
- global.requests[request_id].request.for_filter = "";
102
99
  }
103
100
 
104
101
  global.requests[request_id].response = data.response;
105
102
  if (data.response.body && data.response.body.text) {
106
- global.requests[request_id].response.for_filter = prepare_for_filter(
103
+ global.requests[request_id].filter += " " + prepare_for_filter(
107
104
  parse_raw_text(
108
105
  data.response.body.text,
109
106
  data.response.body.content_type
110
107
  ) || data.response.body.text
111
108
  );
112
- } else {
113
- global.requests[request_id].response.for_filter = "";
114
109
  }
115
110
 
116
111
  // the full stack is not present in request summary
@@ -11,36 +11,30 @@ function update_filter_url() {
11
11
 
12
12
  if (value == "") {
13
13
  // if there is no filter, all rows are visible
14
- sheet.insertRule("[data-filter-url] {display: table-row;}");
15
- sheet.insertRule("[data-filter-request] {display: table-row;}");
16
- sheet.insertRule("[data-filter-response] {display: table-row;}");
14
+ sheet.insertRule("[data-filter] {display: table-row;}");
17
15
  sheet.insertRule(".initiator-header {display: table-row-group;}");
18
16
  } else {
19
17
  // if there is a filter, only the requests that match the filter are visible
20
- sheet.insertRule('[data-filter-url*="' + value + '"] {display: table-row;}');
21
- sheet.insertRule('[data-filter-request*="' + value + '"] {display: table-row;}');
22
- sheet.insertRule('[data-filter-response*="' + value + '"] {display: table-row;}');
18
+ sheet.insertRule('[data-filter*="' + value + '"] {display: table-row;}');
23
19
  if (CSS.supports("selector(:has(*))")) {
24
20
  // an initiator row is visible only if it contains at least one visible request
25
- sheet.insertRule('.initiator-header:has([data-filter-url*="' + value + '"]) {display: table-row-group;}');
26
- sheet.insertRule('.initiator-header:has([data-filter-request*="' + value + '"]) {display: table-row-group;}');
27
- sheet.insertRule('.initiator-header:has([data-filter-response*="' + value + '"]) {display: table-row-group;}');
21
+ sheet.insertRule('.initiator-header:has([data-filter*="' + value + '"]) {display: table-row-group;}');
28
22
  // if there is a filter and no request visible, the filter icon is red
29
- sheet.insertRule('.requests-table:not(:has([data-filter-url*="' + value + '"])):has(tbody) .icon-filter {filter: grayscale(0%) !important;}');
30
- sheet.insertRule('.requests-table:not(:has([data-filter-request*="' + value + '"])):has(tbody) .icon-filter {filter: grayscale(0%) !important;}');
31
- sheet.insertRule('.requests-table:not(:has([data-filter-response*="' + value + '"])):has(tbody) .icon-filter {filter: grayscale(0%) !important;}');
23
+ sheet.insertRule('.requests-table:not(:has([data-filter*="' + value + '"])):has(tbody) .icon-filter {filter: grayscale(0%) !important;}');
32
24
  } else {
33
25
  // in case :has is not supported, the initiator rows are always visible
34
26
  sheet.insertRule(".initiator-header {display: table-row-group;}");
35
27
  }
36
28
  }
29
+
30
+ filter_requests_count();
37
31
  }
38
32
 
39
33
  function collapse_initiator(initiator_id, collapse) {
40
34
  if (collapse) {
41
35
  global.initiator_collapse.push(initiator_id);
42
36
  } else {
43
- let index = global.initiator_collapse.indexOf(initiator_id);
37
+ let index = global.initiator_collapse.indexOf(initiator_id);
44
38
  if (index !== -1) {
45
39
  global.initiator_collapse.splice(index, 1);
46
40
  }
@@ -60,3 +54,19 @@ function update_collapse_initiator() {
60
54
  sheet.insertRule('[data-initiator="' + initiator_id + '"] {display: none;}');
61
55
  }
62
56
  }
57
+
58
+ function filter_requests_count() {
59
+ var filter = document.getElementById("filter-url").value;
60
+ var counter = document.getElementById("filter-requests-count");
61
+
62
+ const nb_total = Object.keys(global.requests).length || 0;
63
+ var nb_found = nb_total;
64
+
65
+ if (filter) {
66
+ filter = prepare_for_filter(filter);
67
+ var table = document.getElementById("requests-list");
68
+ nb_found = table.querySelectorAll('[data-filter*="' + filter + '"]').length;
69
+ }
70
+
71
+ counter.innerText = nb_found + "/" + nb_total + " requests";
72
+ }
@@ -141,15 +141,19 @@
141
141
  <th class="method" title="method"></th>
142
142
  <th class="url">
143
143
  url
144
+ &nbsp;
144
145
  <img class="icon icon-filter"
145
146
  src="static/icons/filter-outline-icon.svg-+-$**HTTPDBG_VERSION**$"
146
147
  alt="filter for url" />
148
+ &nbsp;
147
149
  <label for="filter-url" class="visuallyhidden">
148
150
  filter for url
149
151
  </label>
150
- <input type="text" value="" id="filter-url" title="filter for url"
152
+ <input type="text" value="" id="filter-url" title="match the url or the request payload"
151
153
  onkeyup="update_filter_url()" oncut="update_filter_url()" onpaste="update_filter_url()"
152
154
  onchange="update_filter_url()">
155
+ &nbsp;
156
+ <span id="filter-requests-count">0/0 requests</span>
153
157
  </th>
154
158
  </tr>
155
159
  </thead>
@@ -170,9 +174,7 @@
170
174
 
171
175
  <script id="template_request" type="x-tmpl-mustache">
172
176
  <tr id="request-{{id}}"
173
- data-filter-url="{{url}}"
174
- data-filter-request="{{request.for_filter}}"
175
- data-filter-response="{{response.for_filter}}"
177
+ data-filter="{{filter}}"
176
178
  data-initiator="{{initiator.id}}"
177
179
  onclick="select_request(arguments[0], '{{id}}')"
178
180
  onkeypress="shortcut_request(event, '{{id}}')"
@@ -39,6 +39,7 @@ async function refresh_resquests() {
39
39
  request.to_refresh = false;
40
40
  }
41
41
  };
42
+ filter_requests_count();
42
43
  }
43
44
 
44
45
 
@@ -22,6 +22,7 @@
22
22
  text-align: left;
23
23
  overflow: hidden;
24
24
  width: auto;
25
+ font-weight: normal;
25
26
  }
26
27
 
27
28
  .url-content {
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: httpdbg
3
- Version: 0.24.2
3
+ Version: 0.26.0
4
4
  Summary: A very simple tool to debug HTTP(S) client requests
5
5
  Author-email: cle-b <cle@tictac.pm>
6
6
  License: Apache-2.0
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes