Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-selector
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
uplex-varnish
libvmod-selector
Commits
3705ca88
Commit
3705ca88
authored
Jul 07, 2018
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Verify 'called without prior match' error handling for .sub().
parent
6982889d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
sub.vtc
src/tests/sub.vtc
+41
-0
No files found.
src/tests/sub.vtc
View file @
3705ca88
...
...
@@ -128,3 +128,44 @@ client c1 {
expect resp.http.N-6 == "barbar"
expect resp.http.N-7 == "/?foobar=2"
} -run
varnish v1 -vcl {
import ${vmod_selector};
import std;
backend b { .host = "${bad_ip}"; }
sub vcl_init {
new s = selector.set();
s.add("foo", regex="bar");
}
sub vcl_recv {
return (synth(200));
}
sub vcl_synth {
set resp.http.Sub = s.sub("foo", "bar");
set resp.http.Sub-False = s.sub("foo", "bar", false);
set resp.http.Suball = s.sub("foo", "bar", true);
return (deliver);
}
}
logexpect l1 -v v1 -d 0 -g vxid -q "VCL_Error" {
expect 0 * Begin req
expect * = VCL_Error {^vmod selector error: s\.sub\(\) called without prior match$}
expect * = VCL_Error {^vmod selector error: s\.sub\(\) called without prior match$}
expect * = VCL_Error {^vmod selector error: s\.sub\(\) called without prior match$}
expect * = End
} -start
client c1 {
txreq
rxresp
expect resp.status == 200
expect resp.http.Sub == ""
expect resp.http.Sub-False == ""
expect resp.http.Suball == ""
} -run
logexpect l1 -wait
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