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