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