From 4c070008187d85e13cf7901356021aa7c065d1a4 Mon Sep 17 00:00:00 2001 From: Klaas van Schelven Date: Sat, 8 Nov 2025 20:54:52 +0100 Subject: [PATCH] Add 'send_random_data' 'bomb' credit @Cycloctane (who provided this as a curl command) --- bsmain/management/commands/send_bomb.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/bsmain/management/commands/send_bomb.py b/bsmain/management/commands/send_bomb.py index 20d5d58..7c2c106 100644 --- a/bsmain/management/commands/send_bomb.py +++ b/bsmain/management/commands/send_bomb.py @@ -52,8 +52,28 @@ class Command(BaseCommand): else: dsn = options['dsn'] + if size == -1: + return self.send_random_data(dsn) + self.send_to_server(dsn, size, compress) + def send_random_data(self, dsn): + # the string "random" is not actually random since it has emperically been determined to trigger a failing code + # path in brotli decompression in Bugsin 2.0.5. + + headers = { + "Content-Encoding": "br", + "Content-Type": "application/json", + } + response = requests.post( + get_envelope_url(dsn), + headers=headers, + data=b"random", + timeout=100, + ) + print("Server responded with status code %d" % response.status_code) + print("Response content: %s" % response.content) + def construct_br_bomb(self, header, size): construction_chunk_size = min(100 * MiB, size // 10)