blob: 9db3b64efdeeb63926ecefccba6a6d545ffdacc0 [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
14 timeout connect 1s
15 timeout client 1s
16 timeout server 1s
17
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