Commit 1e1de6d
committed
Fix form url encoding when charset is not UTF-8, close AsyncHttpClient#1444
Motivation:
form urlencoding doesn’t properly honor charset. It uses it for
converting the bytes while those are supposed to be already in the
US-ASCII range. It should be using it the first encode into bytes,
which should be then escaped.
Modifications:
Use current optimized code for UTF-8 and fall back to URLEncoder for
other charsets.
Results:
Proper encoding when charset is different from UTF-8, eg GBK1 parent 0d9a1f3 commit 1e1de6d
File tree
2 files changed
+68
-14
lines changed- client/src
- main/java/org/asynchttpclient/util
- test/java/org/asynchttpclient/util
2 files changed
+68
-14
lines changedLines changed: 25 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
82 | 84 | | |
83 | 85 | | |
84 | 86 | | |
85 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
86 | 92 | | |
87 | 93 | | |
88 | | - | |
| 94 | + | |
89 | 95 | | |
90 | 96 | | |
91 | 97 | | |
92 | 98 | | |
93 | 99 | | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
| 100 | + | |
| 101 | + | |
100 | 102 | | |
101 | 103 | | |
102 | | - | |
| 104 | + | |
103 | 105 | | |
104 | 106 | | |
105 | 107 | | |
106 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
107 | 122 | | |
108 | 123 | | |
109 | 124 | | |
| |||
Lines changed: 43 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
| 18 | + | |
| 19 | + | |
17 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
18 | 24 | | |
19 | | - | |
| 25 | + | |
| 26 | + | |
20 | 27 | | |
21 | 28 | | |
22 | 29 | | |
| 30 | + | |
23 | 31 | | |
| 32 | + | |
24 | 33 | | |
25 | 34 | | |
26 | 35 | | |
| |||
92 | 101 | | |
93 | 102 | | |
94 | 103 | | |
95 | | - | |
| 104 | + | |
96 | 105 | | |
97 | 106 | | |
98 | 107 | | |
99 | 108 | | |
100 | 109 | | |
101 | | - | |
| 110 | + | |
102 | 111 | | |
103 | 112 | | |
104 | 113 | | |
105 | 114 | | |
106 | 115 | | |
107 | | - | |
| 116 | + | |
108 | 117 | | |
109 | 118 | | |
110 | 119 | | |
| |||
160 | 169 | | |
161 | 170 | | |
162 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
163 | 202 | | |
0 commit comments