Seems like we are prepared for UTF-8

Patch best viewed with -b
parent c5e9ef53
......@@ -6,23 +6,32 @@ server s1 {
} -start
varnish v1 -vcl+backend {
import blob;
import re from "${vmod_topbuild}/src/.libs/libvmod_re.so";
sub vcl_init {
new foobar = re.regex("foobar");
new foobar = re.regex("foobar");
new snafu = re.regex("snafu");
new bar = re.regex("bar");
new unicode = re.regex("(*UTF)Sm.rrebr.d");
}
sub vcl_recv {
if (foobar.match(req.url)) {
return(pass);
} else if (snafu.match(req.url)) {
return(pipe);
} else {
return(pass);
}
}
sub vcl_recv {
if (req.url ~ "%") {
set req.url = blob.transcode(decoding=URL,
encoded=req.url);
}
if (unicode.match(req.url)) {
return(synth(200, "Yummy"));
} else if (foobar.match(req.url)) {
return(pass);
} else if (snafu.match(req.url)) {
return(pipe);
} else {
return(pass);
}
}
sub vcl_backend_response {
if (bar.match(beresp.http.foo)) {
......@@ -46,4 +55,9 @@ client c1 {
expect resp.status == "200"
expect resp.http.foo1 == "1"
expect resp.http.bar1 == "2"
txreq -url "/Sm%C3%B8rrebr%C3%B8d"
rxresp
expect resp.status == "200"
expect resp.reason == "Yummy"
} -run
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment