1
0
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:
jeremystretch
2021-08-23 11:32:47 -04:00
parent aef8c5fbb5
commit 75c62ff729

View File

@@ -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"