Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
k8s-ingress
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
3
Merge Requests
3
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
uplex-varnish
k8s-ingress
Commits
84b98dc4
Commit
84b98dc4
authored
Jan 07, 2019
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ACL X-Forwarded-For "2nd-to-last" also works with IPv6 addresses.
parent
02a2a5c9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
acl.golden
pkg/varnish/vcl/testdata/acl.golden
+1
-1
vcl.go
pkg/varnish/vcl/vcl.go
+1
-1
No files found.
pkg/varnish/vcl/testdata/acl.golden
View file @
84b98dc4
...
...
@@ -51,7 +51,7 @@ sub vcl_recv {
return(synth(403));
}
if (
std.ip(regsub(req.http.X-Forwarded-For,"^.*?([
\d
.]+)\s*,[^,]*$","\1"), "0.0.0.0") !~ vk8s_local_acl
std.ip(regsub(req.http.X-Forwarded-For,"^.*?([
[:xdigit:]:
.]+)\s*,[^,]*$","\1"), "0.0.0.0") !~ vk8s_local_acl
) {
return(synth(403));
}
...
...
pkg/varnish/vcl/vcl.go
View file @
84b98dc4
...
...
@@ -533,7 +533,7 @@ func aclMask(bits uint8) string {
const
(
xffFirst
=
`regsub(req.http.X-Forwarded-For,"^([^,\s]+).*","\1")`
xff2ndLast
=
`regsub(req.http.X-Forwarded-For,"^.*?([
\d
.]+)\s*,[^,]*$","\1")`
xff2ndLast
=
`regsub(req.http.X-Forwarded-For,"^.*?([
[:xdigit:]:
.]+)\s*,[^,]*$","\1")`
)
func
aclCmp
(
comparand
string
)
string
{
...
...
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