Skip to content

Commit

Permalink
add check for insecure localhost (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmt committed Jun 14, 2023
1 parent 4d20fe1 commit 4de2490
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,11 @@ func (n *Node) initAdminAPI() error {
n.Log.Info("skipping admin API initialization because it has been disabled")
return nil
}

if (n.Config.HTTPHost == "localhost" || n.Config.HTTPHost == "127.0.0.1") && !n.Config.APIConfig.AllowInsecureLocalhost {
return errors.New("localhost/127.0.0.1 are considered to be insecure hosts - please explicitly allow this by also setting --http-insecure-localhost")
}

n.Log.Info("initializing admin API")
service, err := admin.NewService(
admin.Config{
Expand Down

0 comments on commit 4de2490

Please sign in to comment.