mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-25 01:48:38 -06:00
Print request index after webhook data dump
This commit is contained in:
parent
aef8c5fbb5
commit
75c62ff729
@ -37,12 +37,10 @@ class WebhookHandler(BaseHTTPRequestHandler):
|
|||||||
self.end_headers()
|
self.end_headers()
|
||||||
self.wfile.write(b'Webhook received!\n')
|
self.wfile.write(b'Webhook received!\n')
|
||||||
|
|
||||||
request_counter += 1
|
# Print the request headers
|
||||||
|
|
||||||
# Print the request headers to stdout
|
|
||||||
if self.show_headers:
|
if self.show_headers:
|
||||||
for k, v in self.headers.items():
|
for k, v in self.headers.items():
|
||||||
print('{}: {}'.format(k, v))
|
print(f'{k}: {v}')
|
||||||
print()
|
print()
|
||||||
|
|
||||||
# Print the request body (if any)
|
# Print the request body (if any)
|
||||||
@ -55,8 +53,11 @@ class WebhookHandler(BaseHTTPRequestHandler):
|
|||||||
else:
|
else:
|
||||||
print('(No body)')
|
print('(No body)')
|
||||||
|
|
||||||
|
print(f'Completed request #{request_counter}')
|
||||||
print('------------')
|
print('------------')
|
||||||
|
|
||||||
|
request_counter += 1
|
||||||
|
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
help = "Start a simple listener to display received HTTP requests"
|
help = "Start a simple listener to display received HTTP requests"
|
||||||
|
Loading…
Reference in New Issue
Block a user