From e19615dbb535913cc8c861326efc5abd3ea23db2 Mon Sep 17 00:00:00 2001 From: Jacob Mealey Date: Mon, 19 Feb 2024 14:37:30 -0500 Subject: [PATCH] add tests cases from open issues To verify use of null bytes in URLs --- tests.json | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/tests.json b/tests.json index e5b846ce..9986223c 100644 --- a/tests.json +++ b/tests.json @@ -2355,5 +2355,73 @@ "stderr": "trurl note: key 'key' not in url, appending to query\n", "returncode": 0 } + }, + { + "input": { + "arguments": [ + "0?00%000000000000000000000=0000000000" + ] + }, + "expected": { + "stdout": "http://0.0.0.0/?00%000000000000000000000=0000000000\n", + "stderr": "", + "returncode": 0 + } + }, + { + "input": { + "arguments": [ + "--json", + "0?0%000000000000000000000000000000000" + ] + }, + "expected": { + "returncode": 0, + "stderr": "", + "stdout": [ + { + "url": "http://0.0.0.0/?0%000000000000000000000000000000000", + "parts": { + "scheme": "http", + "host": "0.0.0.0", + "path": "/" + }, + "params": [ + { + "key": "0\u00000000000000000000000000000000000", + "value": "" + } + ] + } + ] + } + }, + { + "input": { + "arguments": [ + "--json", + "0?0%000000000000000000000000000000000=000%0000000000" + ] + }, + "expected": { + "returncode": 0, + "stderr": "", + "stdout": [ + { + "url": "http://0.0.0.0/?0%000000000000000000000000000000000=000%0000000000", + "parts": { + "scheme": "http", + "host": "0.0.0.0", + "path": "/" + }, + "params": [ + { + "key": "0\u00000000000000000000000000000000000", + "value": "000\u000000000000" + } + ] + } + ] + } } ]