Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
9799d980
Commit
9799d980
authored
Feb 07, 2019
by
Darren Shepherd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ability to disable proxy hostname check
parent
0ef79878
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
utils.go
pkg/proxy/util/utils.go
+5
-0
No files found.
pkg/proxy/util/utils.go
View file @
9799d980
...
@@ -40,6 +40,7 @@ const (
...
@@ -40,6 +40,7 @@ const (
var
(
var
(
ErrAddressNotAllowed
=
errors
.
New
(
"address not allowed"
)
ErrAddressNotAllowed
=
errors
.
New
(
"address not allowed"
)
ErrNoAddresses
=
errors
.
New
(
"No addresses for hostname"
)
ErrNoAddresses
=
errors
.
New
(
"No addresses for hostname"
)
DisableProxyHostnameCheck
=
false
)
)
func
IsZeroCIDR
(
cidr
string
)
bool
{
func
IsZeroCIDR
(
cidr
string
)
bool
{
...
@@ -72,6 +73,10 @@ type Resolver interface {
...
@@ -72,6 +73,10 @@ type Resolver interface {
// IsProxyableHostname checks if the IP addresses for a given hostname are permitted to be proxied
// IsProxyableHostname checks if the IP addresses for a given hostname are permitted to be proxied
func
IsProxyableHostname
(
ctx
context
.
Context
,
resolv
Resolver
,
hostname
string
)
error
{
func
IsProxyableHostname
(
ctx
context
.
Context
,
resolv
Resolver
,
hostname
string
)
error
{
if
DisableProxyHostnameCheck
{
return
nil
}
resp
,
err
:=
resolv
.
LookupIPAddr
(
ctx
,
hostname
)
resp
,
err
:=
resolv
.
LookupIPAddr
(
ctx
,
hostname
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
...
...
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