Commit 2562f0c
Fix Bug 6456: Handle malformed percent-encoded URLs gracefully
When recording HTTP traffic via the HTTP(S) Test Script Recorder, JMeter
would crash with IllegalArgumentException when encountering malformed
percent-encoded parameters (e.g., "%u2", "%ZZ", "text%") from real-world
web applications.
Changes:
- HTTPArgument constructor now catches IllegalArgumentException from
URLDecoder.decode() in addition to UnsupportedEncodingException
- When malformed encoding is detected, the original encoded value is
preserved and a warning is logged instead of crashing
- Added comprehensive test cases covering various malformed encoding
scenarios: incomplete hex sequences, invalid hex characters, truncated
percent signs, and mixed valid/invalid encoding
This allows JMeter to successfully record and test applications with
encoding bugs, which is a legitimate use case for a testing tool.1 parent 02e5f59 commit 2562f0c
File tree
2 files changed
+40
-0
lines changed- src/protocol/http/src
- main/java/org/apache/jmeter/protocol/http/util
- test/java/org/apache/jmeter/protocol/http/util
2 files changed
+40
-0
lines changedLines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
164 | 171 | | |
165 | 172 | | |
166 | 173 | | |
| |||
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
96 | 129 | | |
0 commit comments