Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-re2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nils Goroll
libvmod-re2
Commits
fa4f94a8
Commit
fa4f94a8
authored
Mar 28, 2016
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tests for utf8 encoding with the suball() function
parent
9bc5223d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
0 deletions
+47
-0
encoding.vtc
src/tests/encoding.vtc
+47
-0
No files found.
src/tests/encoding.vtc
View file @
fa4f94a8
...
@@ -237,3 +237,50 @@ client c1 {
...
@@ -237,3 +237,50 @@ client c1 {
expect resp.http.patternbytes == "fallback"
expect resp.http.patternbytes == "fallback"
expect resp.http.patternchars == "z"
expect resp.http.patternchars == "z"
} -run
} -run
# suball() function
varnish v1 -vcl {
import re2 from "${vmod_topbuild}/src/.libs/libvmod_re2.so";
backend b { .host = "${bad_ip}"; }
sub vcl_recv {
return(synth(200));
}
sub vcl_synth {
set resp.http.ninebytes =
re2.suball("^.........$",
{"日扼語"}, "z");
set resp.http.threechars =
re2.suball("^...$",
{"日扼語"}, "z",
utf8=true);
set resp.http.bytes =
re2.suball({"日扼語"},
{"日扼語"}, "z");
set resp.http.chars =
re2.suball({"日扼語"},
{"日扼語"}, "z",
utf8=true);
set resp.http.patternbytes =
re2.suball({"^.扼.$"},
{"日扼語"}, "z",
fallback="fallback");
set resp.http.patternchars =
re2.suball({"^.扼.$"},
{"日扼語"}, "z",
utf8=true);
}
}
client c1 {
txreq
rxresp
expect resp.http.ninebytes == "z"
expect resp.http.threechars == "z"
expect resp.http.bytes == "z"
expect resp.http.chars == "z"
expect resp.http.patternbytes == "fallback"
expect resp.http.patternchars == "z"
} -run
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment