mirror of
https://github.com/safing/portmaster
synced 2025-09-16 17:59:41 +00:00
Improve api firewall bypass
This commit is contained in:
parent
fc8fab1a03
commit
0a5981c657
2 changed files with 8 additions and 7 deletions
|
@ -23,9 +23,8 @@ import (
|
|||
var (
|
||||
dataRoot *utils.DirStructure
|
||||
|
||||
apiAddressSet bool
|
||||
apiIP net.IP
|
||||
apiPort uint16
|
||||
apiPortSet bool
|
||||
apiPort uint16
|
||||
)
|
||||
|
||||
func prepAPIAuth() error {
|
||||
|
@ -35,11 +34,13 @@ func prepAPIAuth() error {
|
|||
|
||||
func startAPIAuth() {
|
||||
var err error
|
||||
apiIP, apiPort, err = parseHostPort(apiListenAddress())
|
||||
_, apiPort, err = parseHostPort(apiListenAddress())
|
||||
if err != nil {
|
||||
log.Warningf("firewall: failed to parse API address for improved api auth mechanism: %s", err)
|
||||
return
|
||||
}
|
||||
apiAddressSet = true
|
||||
apiPortSet = true
|
||||
log.Tracef("firewall: api port set to %d", apiPort)
|
||||
}
|
||||
|
||||
func apiAuthenticator(s *http.Server, r *http.Request) (grantAccess bool, err error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue