From 8a6350d9e7c5c365158a24c94edf766da99b18a2 Mon Sep 17 00:00:00 2001 From: DollarSign23 Date: Fri, 18 Jul 2025 10:12:02 +0200 Subject: [PATCH] Add handler for returning JSON with UTF-8 BOM prefix --- test/integration/targets/uri/files/testserver.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/integration/targets/uri/files/testserver.py b/test/integration/targets/uri/files/testserver.py index 1792829091b..30fbe065709 100644 --- a/test/integration/targets/uri/files/testserver.py +++ b/test/integration/targets/uri/files/testserver.py @@ -18,6 +18,14 @@ if __name__ == '__main__': b'a\r\n' # size of the chunk (0xa = 10) b'123456' ) + elif self.path == '/bom_json': + # Return JSON with UTF-8 BOM prefix + self.send_response(200) + self.send_header("Content-type", content_type_json) + self.end_headers() + # \xef\xbb\xbf is the UTF-8 BOM + response = b'\xef\xbb\xbf{"name": "dollarsign", "symbol": "$"}' + self.wfile.write(response) elif self.path.endswith('json'): try: with open(self.path[1:]) as f: