# Those instructions tell emacs to use utf-8 encoding for this source;
# you might want to set up your editor similarly.
...
...
@@ -494,7 +494,7 @@ varnish v1 -vcl {
set resp.http.r1 = r1.match("aBc 0 x x ! x AbCx");
set resp.http.r2 = r2.match("a1 bb ~~");
set resp.http.r3 = r3.match({" _ 123456789"});
set resp.http.r4 = r4.match({"ab12!"§$%&/ xyz !"§$%&/"});
set resp.http.r4 = r4.match({"ab12!"$%&/ xyz !"$%&/"});
set resp.http.r5 = r5.match({" _ABCXYZ _abcXYZ987"});
set resp.http.r6 = r6.match("0123456789abcdef");
}
...
...
@@ -549,3 +549,42 @@ client c1 {
expect resp.http.r1 == "true"
expect resp.http.r2 == "false"
} -run
# max_pattern_len
# Just check if compiles succeed.
varnish v1 -vcl {
import pcre2 from "${vmod_topbuild}/src/.libs/libvmod_pcre2.so";
backend b { .host = "${bad_ip}"; }
sub vcl_init {
new r1 = pcre2.regex("abc", max_pattern_len=3);
new r2 = pcre2.regex("", max_pattern_len=3);
}
}
varnish v1 -errvcl {vmod pcre2 error: Cannot compile 'abcd' in r constructor: pattern string is longer than the limit set by the application at offset 0} {
import pcre2 from "${vmod_topbuild}/src/.libs/libvmod_pcre2.so";