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
b0e9f92f
Commit
b0e9f92f
authored
Jul 08, 2018
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor doc polish.
parent
0b40f914
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
12 deletions
+22
-12
README.rst
README.rst
+10
-5
vmod_selector.vcc
src/vmod_selector.vcc
+12
-7
No files found.
README.rst
View file @
b0e9f92f
...
...
@@ -604,16 +604,21 @@ prior match was case insensitive, and the matched string differs in
case, the string with the case as added to the set is returned.
``.element()`` fails and returns NULL if the rules for ``n`` and
``select`` indicate failure; that is, if ``n`` is out of range
(greater than the number of elements in the set), or if ``n`` < 1 and
``select`` fails for ``UNIQUE`` or ``EXACT``, or ``n`` < 1 and there
was no prior invocation of ``.match()`` or ``.hasprefix()``.
``select`` indicate failure; that is:
* ``n`` is out of range (greater than the number of elements in the
set)
* ``n`` < 1 and ``select`` fails for ``UNIQUE`` or ``EXACT``
* ``n`` < 1 and there was no prior invocation of ``.match()`` or
``.hasprefix()``.
Example::
if (myset.hasprefix(req.url)) {
# Construct a redirect response for another host, using the
# matching prefix in the request URL as the new URL.
# matching prefix in the request URL as the new URL
path
.
set resp.http.Location = "http://other.com" + myset.element();
}
...
...
src/vmod_selector.vcc
View file @
b0e9f92f
...
...
@@ -520,16 +520,21 @@ prior match was case insensitive, and the matched string differs in
case, the string with the case as added to the set is returned.
``.element()`` fails and returns NULL if the rules for ``n`` and
``select`` indicate failure; that is, if ``n`` is out of range
(greater than the number of elements in the set), or if ``n`` < 1 and
``select`` fails for ``UNIQUE`` or ``EXACT``, or ``n`` < 1 and there
was no prior invocation of ``.match()`` or ``.hasprefix()``.
``select`` indicate failure; that is:
* ``n`` is out of range (greater than the number of elements in the
set)
* ``n`` < 1 and ``select`` fails for ``UNIQUE`` or ``EXACT``
* ``n`` < 1 and there was no prior invocation of ``.match()`` or
``.hasprefix()``.
Example::
if (myset.hasprefix(req.url)) {
# Construct a redirect response for another host, using the
# matching prefix in the request URL as the new URL.
# matching prefix in the request URL as the new URL
path
.
set resp.http.Location = "http://other.com" + myset.element();
}
...
...
@@ -629,8 +634,8 @@ If ``all`` is ``false``, then return the result of replacing the first
portion of ``str`` that matches the regex with ``sub``. ``sub`` may
contain backreferences ``\0`` through ``\9``, to include captured
substrings from ``str`` in the substitution. This is the same
operation performed by the native VCL function
``regsub(str, regex,
sub)`` (see vcl(7)). By default, ``all`` is false.
operation performed by the native VCL function
``regsub(str, regex,
sub)`` (see vcl(7)). By default, ``all`` is false.
If ``all`` is ``true``, return the result of replacing each
non-overlapping portion of ``str`` that matches the regex with ``sub``
...
...
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