Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-frozen
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-frozen
Commits
c6423d0f
Commit
c6423d0f
authored
Mar 17, 2019
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demo string-extraction of an array
Ref
https://gitlab.com/uplex/varnish/libvmod-frozen/issues/1
parent
38c93959
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
vmod_frozen.vtc
src/vtc/vmod_frozen.vtc
+11
-0
No files found.
src/vtc/vmod_frozen.vtc
View file @
c6423d0f
...
...
@@ -17,6 +17,10 @@ varnish v1 -vcl+backend {
p_test.expect(".e");
p_test.expect(".f[0]");
p_test.expect(".f[1]");
# implementation detail: matching the array after it is complete
# is most efficient
p_test.expect(".f");
p_test.expect(".g.1");
p_test.expect(".g.h[0]");
}
...
...
@@ -48,6 +52,11 @@ varnish v1 -vcl+backend {
set resp.http.f1 = p_test.extract(".f[1]");
set resp.http.f1-type = p_test.type(".f[1]");
# implementation detail: matching the array after it is complete
# is most efficient
set resp.http.f = p_test.extract(".f");
set resp.http.f-type = p_test.type(".f");
set resp.http.g1 = p_test.extract({".g.1"});
set resp.http.g1-type = p_test.type({".g.1"});
...
...
@@ -75,6 +84,8 @@ client c1 {
expect resp.http.f0-type == NUMBER
expect resp.http.f1 == -2
expect resp.http.f1-type == NUMBER
expect resp.http.f == "[ 1, -2, 3]"
expect resp.http.f-type == ARRAY
expect resp.http.g1 == "[]"
expect resp.http.g1-type == ARRAY
expect resp.http.gh0 == 7
...
...
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