blob: d5e317bb2c70109c83d7cc0aa447805b6186e688 [file] [log] [blame]
William Dauchya2a46ee2020-11-15 14:04:43 +01001varnishtest "url_dec converter Test"
2
William Dauchya2a46ee2020-11-15 14:04:43 +01003
4feature ignore_unknown_macro
5
6server s1 {
7 rxreq
8 txresp
9} -repeat 2 -start
10
11haproxy h1 -conf {
12 defaults
13 mode http
Willy Tarreauf6739232021-11-18 17:46:22 +010014 timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
15 timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
16 timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
William Dauchya2a46ee2020-11-15 14:04:43 +010017
18 frontend fe
19 bind "fd@${fe}"
20
21 http-request set-var(txn.url) url
22 http-response set-header url_dec0 "%[var(txn.url),url_dec]"
23 http-response set-header url_dec1 "%[var(txn.url),url_dec(1)]"
24
25 default_backend be
26
27 backend be
28 server s1 ${s1_addr}:${s1_port}
29} -start
30
31client c1 -connect ${h1_fe_sock} {
32 txreq -url "/bla+%20?foo%3Dbar%2B42+42%20"
33 rxresp
34 expect resp.http.url_dec0 == "/bla+ ?foo=bar+42 42 "
35 expect resp.http.url_dec1 == "/bla ?foo=bar+42 42 "
36 expect resp.status == 200
37} -run