Tim Duesterhus | d371e99 | 2021-04-15 21:45:58 +0200 | [diff] [blame] | 1 | varnishtest "normalize-uri tests" |
| 2 | #REQUIRE_VERSION=2.4 |
| 3 | |
| 4 | # This reg-test tests the http-request normalize-uri action. |
| 5 | |
| 6 | feature ignore_unknown_macro |
| 7 | |
| 8 | server s1 { |
| 9 | rxreq |
| 10 | txresp |
Tim Duesterhus | 2e4a18e | 2021-04-21 21:20:36 +0200 | [diff] [blame] | 11 | } -repeat 63 -start |
Tim Duesterhus | d371e99 | 2021-04-15 21:45:58 +0200 | [diff] [blame] | 12 | |
| 13 | haproxy h1 -conf { |
Amaury Denoyelle | a9e639a | 2021-05-06 15:50:12 +0200 | [diff] [blame] | 14 | global |
| 15 | expose-experimental-directives |
| 16 | |
Tim Duesterhus | d371e99 | 2021-04-15 21:45:58 +0200 | [diff] [blame] | 17 | defaults |
| 18 | mode http |
| 19 | timeout connect 1s |
| 20 | timeout client 1s |
| 21 | timeout server 1s |
| 22 | |
Tim Duesterhus | 5be6ab2 | 2021-04-17 11:21:10 +0200 | [diff] [blame] | 23 | frontend fe_path_merge_slashes |
| 24 | bind "fd@${fe_path_merge_slashes}" |
Tim Duesterhus | d371e99 | 2021-04-15 21:45:58 +0200 | [diff] [blame] | 25 | |
| 26 | http-request set-var(txn.before) url |
Tim Duesterhus | 5be6ab2 | 2021-04-17 11:21:10 +0200 | [diff] [blame] | 27 | http-request normalize-uri path-merge-slashes |
Tim Duesterhus | d371e99 | 2021-04-15 21:45:58 +0200 | [diff] [blame] | 28 | http-request set-var(txn.after) url |
| 29 | |
| 30 | http-response add-header before %[var(txn.before)] |
| 31 | http-response add-header after %[var(txn.after)] |
| 32 | |
| 33 | default_backend be |
| 34 | |
Tim Duesterhus | 5be6ab2 | 2021-04-17 11:21:10 +0200 | [diff] [blame] | 35 | frontend fe_path_strip_dotdot |
| 36 | bind "fd@${fe_path_strip_dotdot}" |
Tim Duesterhus | 9982fc2 | 2021-04-15 21:45:59 +0200 | [diff] [blame] | 37 | |
| 38 | http-request set-var(txn.before) url |
Tim Duesterhus | 5be6ab2 | 2021-04-17 11:21:10 +0200 | [diff] [blame] | 39 | http-request normalize-uri path-strip-dotdot |
Tim Duesterhus | 9982fc2 | 2021-04-15 21:45:59 +0200 | [diff] [blame] | 40 | http-request set-var(txn.after) url |
| 41 | |
Tim Duesterhus | 560e1a6 | 2021-04-15 21:46:00 +0200 | [diff] [blame] | 42 | http-request set-uri %[var(txn.before)] |
Tim Duesterhus | 5be6ab2 | 2021-04-17 11:21:10 +0200 | [diff] [blame] | 43 | http-request normalize-uri path-strip-dotdot full |
Tim Duesterhus | 560e1a6 | 2021-04-15 21:46:00 +0200 | [diff] [blame] | 44 | http-request set-var(txn.after_full) url |
| 45 | |
Tim Duesterhus | 9982fc2 | 2021-04-15 21:45:59 +0200 | [diff] [blame] | 46 | http-response add-header before %[var(txn.before)] |
| 47 | http-response add-header after %[var(txn.after)] |
Tim Duesterhus | 560e1a6 | 2021-04-15 21:46:00 +0200 | [diff] [blame] | 48 | http-response add-header after-full %[var(txn.after_full)] |
Tim Duesterhus | 9982fc2 | 2021-04-15 21:45:59 +0200 | [diff] [blame] | 49 | |
| 50 | default_backend be |
| 51 | |
Tim Duesterhus | 5be6ab2 | 2021-04-17 11:21:10 +0200 | [diff] [blame] | 52 | frontend fe_sort_query_by_name |
| 53 | bind "fd@${fe_sort_query_by_name}" |
Tim Duesterhus | d7b89be | 2021-04-15 21:46:01 +0200 | [diff] [blame] | 54 | |
| 55 | http-request set-var(txn.before) url |
Tim Duesterhus | 5be6ab2 | 2021-04-17 11:21:10 +0200 | [diff] [blame] | 56 | http-request normalize-uri query-sort-by-name |
Tim Duesterhus | d7b89be | 2021-04-15 21:46:01 +0200 | [diff] [blame] | 57 | http-request set-var(txn.after) url |
| 58 | |
| 59 | http-response add-header before %[var(txn.before)] |
| 60 | http-response add-header after %[var(txn.after)] |
| 61 | |
| 62 | default_backend be |
| 63 | |
Tim Duesterhus | 5be6ab2 | 2021-04-17 11:21:10 +0200 | [diff] [blame] | 64 | frontend fe_percent_to_uppercase |
| 65 | bind "fd@${fe_percent_to_uppercase}" |
Tim Duesterhus | a407193 | 2021-04-15 21:46:02 +0200 | [diff] [blame] | 66 | |
| 67 | http-request set-var(txn.before) url |
Tim Duesterhus | 5be6ab2 | 2021-04-17 11:21:10 +0200 | [diff] [blame] | 68 | http-request normalize-uri percent-to-uppercase |
Tim Duesterhus | a407193 | 2021-04-15 21:46:02 +0200 | [diff] [blame] | 69 | http-request set-var(txn.after) url |
| 70 | |
| 71 | http-response add-header before %[var(txn.before)] |
| 72 | http-response add-header after %[var(txn.after)] |
| 73 | |
| 74 | default_backend be |
| 75 | |
Tim Duesterhus | 5be6ab2 | 2021-04-17 11:21:10 +0200 | [diff] [blame] | 76 | frontend fe_percent_to_uppercase_strict |
| 77 | bind "fd@${fe_percent_to_uppercase_strict}" |
Tim Duesterhus | a407193 | 2021-04-15 21:46:02 +0200 | [diff] [blame] | 78 | |
| 79 | http-request set-var(txn.before) url |
Tim Duesterhus | 5be6ab2 | 2021-04-17 11:21:10 +0200 | [diff] [blame] | 80 | http-request normalize-uri percent-to-uppercase strict |
Tim Duesterhus | a407193 | 2021-04-15 21:46:02 +0200 | [diff] [blame] | 81 | http-request set-var(txn.after) url |
| 82 | |
| 83 | http-response add-header before %[var(txn.before)] |
| 84 | http-response add-header after %[var(txn.after)] |
| 85 | |
| 86 | default_backend be |
| 87 | |
Maximilian Mader | ff3bb8b | 2021-04-21 00:22:50 +0200 | [diff] [blame] | 88 | frontend fe_dot |
| 89 | bind "fd@${fe_dot}" |
| 90 | |
| 91 | http-request set-var(txn.before) url |
| 92 | http-request normalize-uri path-strip-dot |
| 93 | http-request set-var(txn.after) url |
| 94 | |
| 95 | http-response add-header before %[var(txn.before)] |
| 96 | http-response add-header after %[var(txn.after)] |
| 97 | |
| 98 | default_backend be |
| 99 | |
Tim Duesterhus | 2e4a18e | 2021-04-21 21:20:36 +0200 | [diff] [blame] | 100 | frontend fe_percent_decode_unreserved |
| 101 | bind "fd@${fe_percent_decode_unreserved}" |
| 102 | |
| 103 | http-request set-var(txn.before) url |
| 104 | http-request normalize-uri percent-decode-unreserved |
| 105 | http-request set-var(txn.after) url |
| 106 | |
| 107 | http-response add-header before %[var(txn.before)] |
| 108 | http-response add-header after %[var(txn.after)] |
| 109 | |
| 110 | default_backend be |
| 111 | |
| 112 | frontend fe_percent_decode_unreserved_strict |
| 113 | bind "fd@${fe_percent_decode_unreserved_strict}" |
| 114 | |
| 115 | http-request set-var(txn.before) url |
| 116 | http-request normalize-uri percent-decode-unreserved strict |
| 117 | http-request set-var(txn.after) url |
| 118 | |
| 119 | http-response add-header before %[var(txn.before)] |
| 120 | http-response add-header after %[var(txn.after)] |
| 121 | |
| 122 | default_backend be |
| 123 | |
Tim Duesterhus | d371e99 | 2021-04-15 21:45:58 +0200 | [diff] [blame] | 124 | backend be |
| 125 | server s1 ${s1_addr}:${s1_port} |
| 126 | |
| 127 | } -start |
| 128 | |
Tim Duesterhus | 5be6ab2 | 2021-04-17 11:21:10 +0200 | [diff] [blame] | 129 | client c1 -connect ${h1_fe_path_merge_slashes_sock} { |
Tim Duesterhus | d371e99 | 2021-04-15 21:45:58 +0200 | [diff] [blame] | 130 | txreq -url "/foo/bar" |
| 131 | rxresp |
| 132 | expect resp.http.before == "/foo/bar" |
| 133 | expect resp.http.after == "/foo/bar" |
| 134 | |
| 135 | txreq -url "/foo//bar" |
| 136 | rxresp |
| 137 | expect resp.http.before == "/foo//bar" |
| 138 | expect resp.http.after == "/foo/bar" |
| 139 | |
| 140 | txreq -url "/foo///bar" |
| 141 | rxresp |
| 142 | expect resp.http.before == "/foo///bar" |
| 143 | expect resp.http.after == "/foo/bar" |
| 144 | |
| 145 | txreq -url "///foo///bar" |
| 146 | rxresp |
| 147 | expect resp.http.before == "///foo///bar" |
| 148 | expect resp.http.after == "/foo/bar" |
| 149 | |
| 150 | txreq -url "///foo/bar" |
| 151 | rxresp |
| 152 | expect resp.http.before == "///foo/bar" |
| 153 | expect resp.http.after == "/foo/bar" |
| 154 | |
| 155 | txreq -url "///foo///bar///" |
| 156 | rxresp |
| 157 | expect resp.http.before == "///foo///bar///" |
| 158 | expect resp.http.after == "/foo/bar/" |
| 159 | |
| 160 | txreq -url "///" |
| 161 | rxresp |
| 162 | expect resp.http.before == "///" |
| 163 | expect resp.http.after == "/" |
| 164 | |
| 165 | txreq -url "/foo?bar=///" |
| 166 | rxresp |
| 167 | expect resp.http.before == "/foo?bar=///" |
| 168 | expect resp.http.after == "/foo?bar=///" |
| 169 | |
| 170 | txreq -url "//foo?bar=///" |
| 171 | rxresp |
| 172 | expect resp.http.before == "//foo?bar=///" |
| 173 | expect resp.http.after == "/foo?bar=///" |
| 174 | |
| 175 | txreq -req OPTIONS -url "*" |
| 176 | rxresp |
| 177 | expect resp.http.before == "*" |
| 178 | expect resp.http.after == "*" |
| 179 | } -run |
Tim Duesterhus | 9982fc2 | 2021-04-15 21:45:59 +0200 | [diff] [blame] | 180 | |
Tim Duesterhus | 5be6ab2 | 2021-04-17 11:21:10 +0200 | [diff] [blame] | 181 | client c2 -connect ${h1_fe_path_strip_dotdot_sock} { |
Tim Duesterhus | 9982fc2 | 2021-04-15 21:45:59 +0200 | [diff] [blame] | 182 | txreq -url "/foo/bar" |
| 183 | rxresp |
| 184 | expect resp.http.before == "/foo/bar" |
| 185 | expect resp.http.after == "/foo/bar" |
Tim Duesterhus | 560e1a6 | 2021-04-15 21:46:00 +0200 | [diff] [blame] | 186 | expect resp.http.after-full == "/foo/bar" |
Tim Duesterhus | 9982fc2 | 2021-04-15 21:45:59 +0200 | [diff] [blame] | 187 | |
| 188 | txreq -url "/foo/.." |
| 189 | rxresp |
| 190 | expect resp.http.before == "/foo/.." |
| 191 | expect resp.http.after == "/" |
Tim Duesterhus | 560e1a6 | 2021-04-15 21:46:00 +0200 | [diff] [blame] | 192 | expect resp.http.after-full == "/" |
Tim Duesterhus | 9982fc2 | 2021-04-15 21:45:59 +0200 | [diff] [blame] | 193 | |
| 194 | txreq -url "/foo/../" |
| 195 | rxresp |
| 196 | expect resp.http.before == "/foo/../" |
| 197 | expect resp.http.after == "/" |
Tim Duesterhus | 560e1a6 | 2021-04-15 21:46:00 +0200 | [diff] [blame] | 198 | expect resp.http.after-full == "/" |
Tim Duesterhus | 9982fc2 | 2021-04-15 21:45:59 +0200 | [diff] [blame] | 199 | |
| 200 | txreq -url "/foo/bar/../" |
| 201 | rxresp |
| 202 | expect resp.http.before == "/foo/bar/../" |
| 203 | expect resp.http.after == "/foo/" |
Tim Duesterhus | 560e1a6 | 2021-04-15 21:46:00 +0200 | [diff] [blame] | 204 | expect resp.http.after-full == "/foo/" |
Tim Duesterhus | 9982fc2 | 2021-04-15 21:45:59 +0200 | [diff] [blame] | 205 | |
| 206 | txreq -url "/foo/../bar" |
| 207 | rxresp |
| 208 | expect resp.http.before == "/foo/../bar" |
| 209 | expect resp.http.after == "/bar" |
Tim Duesterhus | 560e1a6 | 2021-04-15 21:46:00 +0200 | [diff] [blame] | 210 | expect resp.http.after-full == "/bar" |
Tim Duesterhus | 9982fc2 | 2021-04-15 21:45:59 +0200 | [diff] [blame] | 211 | |
| 212 | txreq -url "/foo/../bar/" |
| 213 | rxresp |
| 214 | expect resp.http.before == "/foo/../bar/" |
| 215 | expect resp.http.after == "/bar/" |
Tim Duesterhus | 560e1a6 | 2021-04-15 21:46:00 +0200 | [diff] [blame] | 216 | expect resp.http.after-full == "/bar/" |
Tim Duesterhus | 9982fc2 | 2021-04-15 21:45:59 +0200 | [diff] [blame] | 217 | |
| 218 | txreq -url "/foo/../../bar/" |
| 219 | rxresp |
| 220 | expect resp.http.before == "/foo/../../bar/" |
| 221 | expect resp.http.after == "/../bar/" |
Tim Duesterhus | 560e1a6 | 2021-04-15 21:46:00 +0200 | [diff] [blame] | 222 | expect resp.http.after-full == "/bar/" |
Tim Duesterhus | 9982fc2 | 2021-04-15 21:45:59 +0200 | [diff] [blame] | 223 | |
| 224 | txreq -url "/foo//../../bar/" |
| 225 | rxresp |
| 226 | expect resp.http.before == "/foo//../../bar/" |
| 227 | expect resp.http.after == "/bar/" |
Tim Duesterhus | 560e1a6 | 2021-04-15 21:46:00 +0200 | [diff] [blame] | 228 | expect resp.http.after-full == "/bar/" |
Tim Duesterhus | 9982fc2 | 2021-04-15 21:45:59 +0200 | [diff] [blame] | 229 | |
| 230 | txreq -url "/foo/?bar=/foo/../" |
| 231 | rxresp |
| 232 | expect resp.http.before == "/foo/?bar=/foo/../" |
| 233 | expect resp.http.after == "/foo/?bar=/foo/../" |
Tim Duesterhus | 560e1a6 | 2021-04-15 21:46:00 +0200 | [diff] [blame] | 234 | expect resp.http.after-full == "/foo/?bar=/foo/../" |
Tim Duesterhus | 9982fc2 | 2021-04-15 21:45:59 +0200 | [diff] [blame] | 235 | |
| 236 | txreq -url "/foo/../?bar=/foo/../" |
| 237 | rxresp |
| 238 | expect resp.http.before == "/foo/../?bar=/foo/../" |
| 239 | expect resp.http.after == "/?bar=/foo/../" |
Tim Duesterhus | 560e1a6 | 2021-04-15 21:46:00 +0200 | [diff] [blame] | 240 | expect resp.http.after-full == "/?bar=/foo/../" |
Tim Duesterhus | 9982fc2 | 2021-04-15 21:45:59 +0200 | [diff] [blame] | 241 | |
| 242 | txreq -req OPTIONS -url "*" |
| 243 | rxresp |
| 244 | expect resp.http.before == "*" |
| 245 | expect resp.http.after == "*" |
Tim Duesterhus | 560e1a6 | 2021-04-15 21:46:00 +0200 | [diff] [blame] | 246 | expect resp.http.after-full == "*" |
Tim Duesterhus | 9982fc2 | 2021-04-15 21:45:59 +0200 | [diff] [blame] | 247 | } -run |
Tim Duesterhus | d7b89be | 2021-04-15 21:46:01 +0200 | [diff] [blame] | 248 | |
Tim Duesterhus | 5be6ab2 | 2021-04-17 11:21:10 +0200 | [diff] [blame] | 249 | client c3 -connect ${h1_fe_sort_query_by_name_sock} { |
Tim Duesterhus | d7b89be | 2021-04-15 21:46:01 +0200 | [diff] [blame] | 250 | txreq -url "/?a=a" |
| 251 | rxresp |
| 252 | expect resp.http.before == "/?a=a" |
| 253 | expect resp.http.after == "/?a=a" |
| 254 | |
| 255 | txreq -url "/?a=a&z=z" |
| 256 | rxresp |
| 257 | expect resp.http.before == "/?a=a&z=z" |
| 258 | expect resp.http.after == "/?a=a&z=z" |
| 259 | |
| 260 | txreq -url "/?z=z&a=a" |
| 261 | rxresp |
| 262 | expect resp.http.before == "/?z=z&a=a" |
| 263 | expect resp.http.after == "/?a=a&z=z" |
| 264 | |
| 265 | txreq -url "/?a=z&z=a" |
| 266 | rxresp |
| 267 | expect resp.http.before == "/?a=z&z=a" |
| 268 | expect resp.http.after == "/?a=z&z=a" |
| 269 | |
| 270 | txreq -url "/?z=a&a=z" |
| 271 | rxresp |
| 272 | expect resp.http.before == "/?z=a&a=z" |
| 273 | expect resp.http.after == "/?a=z&z=a" |
| 274 | |
| 275 | txreq -url "/?c&b&a&z&x&y" |
| 276 | rxresp |
| 277 | expect resp.http.before == "/?c&b&a&z&x&y" |
| 278 | expect resp.http.after == "/?a&b&c&x&y&z" |
| 279 | |
| 280 | txreq -url "/?a=&aa=&aaa=&aaaa=" |
| 281 | rxresp |
| 282 | expect resp.http.before == "/?a=&aa=&aaa=&aaaa=" |
| 283 | expect resp.http.after == "/?a=&aa=&aaa=&aaaa=" |
| 284 | |
| 285 | txreq -url "/?aaaa=&a=&aa=&aaa=" |
| 286 | rxresp |
| 287 | expect resp.http.before == "/?aaaa=&a=&aa=&aaa=" |
| 288 | expect resp.http.after == "/?a=&aa=&aaa=&aaaa=" |
| 289 | |
| 290 | txreq -url "/?a=5&a=3&a=1&a=2&a=4" |
| 291 | rxresp |
| 292 | expect resp.http.before == "/?a=5&a=3&a=1&a=2&a=4" |
| 293 | expect resp.http.after == "/?a=5&a=3&a=1&a=2&a=4" |
| 294 | |
| 295 | txreq -url "/?a=5&b=3&a=1&a=2&b=4" |
| 296 | rxresp |
| 297 | expect resp.http.before == "/?a=5&b=3&a=1&a=2&b=4" |
| 298 | expect resp.http.after == "/?a=5&a=1&a=2&b=3&b=4" |
| 299 | |
| 300 | txreq -url "/" |
| 301 | rxresp |
| 302 | expect resp.http.before == "/" |
| 303 | expect resp.http.after == "/" |
| 304 | |
| 305 | txreq -url "/?" |
| 306 | rxresp |
| 307 | expect resp.http.before == "/?" |
| 308 | expect resp.http.after == "/?" |
| 309 | |
| 310 | txreq -req OPTIONS -url "*" |
| 311 | rxresp |
| 312 | expect resp.http.before == "*" |
| 313 | expect resp.http.after == "*" |
| 314 | } -run |
Tim Duesterhus | a407193 | 2021-04-15 21:46:02 +0200 | [diff] [blame] | 315 | |
Tim Duesterhus | 5be6ab2 | 2021-04-17 11:21:10 +0200 | [diff] [blame] | 316 | client c4 -connect ${h1_fe_percent_to_uppercase_sock} { |
Tim Duesterhus | a407193 | 2021-04-15 21:46:02 +0200 | [diff] [blame] | 317 | txreq -url "/a?a=a" |
| 318 | rxresp |
| 319 | expect resp.http.before == "/a?a=a" |
| 320 | expect resp.http.after == "/a?a=a" |
| 321 | |
| 322 | txreq -url "/%aa?a=%aa" |
| 323 | rxresp |
| 324 | expect resp.http.before == "/%aa?a=%aa" |
| 325 | expect resp.http.after == "/%AA?a=%AA" |
| 326 | |
| 327 | txreq -url "/%zz?a=%zz" |
| 328 | rxresp |
| 329 | expect resp.status == 200 |
| 330 | expect resp.http.before == "/%zz?a=%zz" |
| 331 | expect resp.http.after == "/%zz?a=%zz" |
| 332 | |
| 333 | txreq -req OPTIONS -url "*" |
| 334 | rxresp |
| 335 | expect resp.http.before == "*" |
| 336 | expect resp.http.after == "*" |
| 337 | } -run |
| 338 | |
Tim Duesterhus | 5be6ab2 | 2021-04-17 11:21:10 +0200 | [diff] [blame] | 339 | client c5 -connect ${h1_fe_percent_to_uppercase_strict_sock} { |
Tim Duesterhus | a407193 | 2021-04-15 21:46:02 +0200 | [diff] [blame] | 340 | txreq -url "/a?a=a" |
| 341 | rxresp |
| 342 | expect resp.http.before == "/a?a=a" |
| 343 | expect resp.http.after == "/a?a=a" |
| 344 | |
| 345 | txreq -url "/%aa?a=%aa" |
| 346 | rxresp |
| 347 | expect resp.http.before == "/%aa?a=%aa" |
| 348 | expect resp.http.after == "/%AA?a=%AA" |
| 349 | |
| 350 | txreq -url "/%zz?a=%zz" |
| 351 | rxresp |
| 352 | expect resp.status == 400 |
| 353 | } -run |
Maximilian Mader | ff3bb8b | 2021-04-21 00:22:50 +0200 | [diff] [blame] | 354 | |
| 355 | client c6 -connect ${h1_fe_dot_sock} { |
| 356 | txreq -url "/" |
| 357 | rxresp |
| 358 | expect resp.http.before == "/" |
| 359 | expect resp.http.after == "/" |
| 360 | |
| 361 | txreq -url "/a/b" |
| 362 | rxresp |
| 363 | expect resp.http.before == "/a/b" |
| 364 | expect resp.http.after == "/a/b" |
| 365 | |
| 366 | txreq -url "/." |
| 367 | rxresp |
| 368 | expect resp.http.before == "/." |
| 369 | expect resp.http.after == "/" |
| 370 | |
| 371 | txreq -url "/./" |
| 372 | rxresp |
| 373 | expect resp.http.before == "/./" |
| 374 | expect resp.http.after == "/" |
| 375 | |
| 376 | txreq -url "/a/." |
| 377 | rxresp |
| 378 | expect resp.http.before == "/a/." |
| 379 | expect resp.http.after == "/a/" |
| 380 | |
| 381 | txreq -url "/a." |
| 382 | rxresp |
| 383 | expect resp.http.before == "/a." |
| 384 | expect resp.http.after == "/a." |
| 385 | |
| 386 | txreq -url "/.a" |
| 387 | rxresp |
| 388 | expect resp.http.before == "/.a" |
| 389 | expect resp.http.after == "/.a" |
| 390 | |
| 391 | txreq -url "/a/." |
| 392 | rxresp |
| 393 | expect resp.http.before == "/a/." |
| 394 | expect resp.http.after == "/a/" |
| 395 | |
| 396 | txreq -url "/a/./" |
| 397 | rxresp |
| 398 | expect resp.http.before == "/a/./" |
| 399 | expect resp.http.after == "/a/" |
| 400 | |
| 401 | txreq -url "/a/./a" |
| 402 | rxresp |
| 403 | expect resp.http.before == "/a/./a" |
| 404 | expect resp.http.after == "/a/a" |
| 405 | |
| 406 | txreq -url "/a/../" |
| 407 | rxresp |
| 408 | expect resp.http.before == "/a/../" |
| 409 | expect resp.http.after == "/a/../" |
| 410 | |
| 411 | txreq -url "/a/../a" |
| 412 | rxresp |
| 413 | expect resp.http.before == "/a/../a" |
| 414 | expect resp.http.after == "/a/../a" |
| 415 | |
| 416 | txreq -url "/?a=/./" |
| 417 | rxresp |
| 418 | expect resp.http.before == "/?a=/./" |
| 419 | expect resp.http.after == "/?a=/./" |
| 420 | } -run |
Tim Duesterhus | 2e4a18e | 2021-04-21 21:20:36 +0200 | [diff] [blame] | 421 | |
| 422 | client c7 -connect ${h1_fe_percent_decode_unreserved_sock} { |
| 423 | txreq -url "/a?a=a" |
| 424 | rxresp |
| 425 | expect resp.http.before == "/a?a=a" |
| 426 | expect resp.http.after == "/a?a=a" |
| 427 | |
| 428 | txreq -url "/%61?%61=%61" |
| 429 | rxresp |
| 430 | expect resp.http.before == "/%61?%61=%61" |
| 431 | expect resp.http.after == "/a?a=a" |
| 432 | |
| 433 | txreq -url "/%3F?foo=bar" |
| 434 | rxresp |
| 435 | expect resp.http.before == "/%3F?foo=bar" |
| 436 | expect resp.http.after == "/%3F?foo=bar" |
| 437 | |
| 438 | txreq -url "/%%36%36" |
| 439 | rxresp |
| 440 | expect resp.status == 200 |
| 441 | expect resp.http.before == "/%%36%36" |
| 442 | expect resp.http.after == "/%66" |
| 443 | |
| 444 | txreq -req OPTIONS -url "*" |
| 445 | rxresp |
| 446 | expect resp.http.before == "*" |
| 447 | expect resp.http.after == "*" |
| 448 | } -run |
| 449 | |
| 450 | client c8 -connect ${h1_fe_percent_decode_unreserved_strict_sock} { |
| 451 | txreq -url "/a?a=a" |
| 452 | rxresp |
| 453 | expect resp.http.before == "/a?a=a" |
| 454 | expect resp.http.after == "/a?a=a" |
| 455 | |
| 456 | txreq -url "/%61?%61=%61" |
| 457 | rxresp |
| 458 | expect resp.http.before == "/%61?%61=%61" |
| 459 | expect resp.http.after == "/a?a=a" |
| 460 | |
| 461 | txreq -url "/%3F?foo=bar" |
| 462 | rxresp |
| 463 | expect resp.http.before == "/%3F?foo=bar" |
| 464 | expect resp.http.after == "/%3F?foo=bar" |
| 465 | |
| 466 | txreq -url "/%%36%36" |
| 467 | rxresp |
| 468 | expect resp.status == 400 |
| 469 | } -run |