diff --git a/daemon/kmd/config/config.go b/daemon/kmd/config/config.go index 4eb947634b..468db8ec03 100644 --- a/daemon/kmd/config/config.go +++ b/daemon/kmd/config/config.go @@ -35,12 +35,12 @@ const ( // KMDConfig contains global configuration information for kmd type KMDConfig struct { - DataDir string `json:"-"` - DriverConfig DriverConfig `json:"drivers"` - SessionLifetimeSecs uint64 `json:"session_lifetime_secs"` - Address string `json:"address"` - AllowedOrigins []string `json:"allowed_origins"` - EnablePrivateNetworkAccessHeader bool `json:"enable_private_network_access_header"` + DataDir string `json:"-"` + DriverConfig DriverConfig `json:"drivers"` + SessionLifetimeSecs uint64 `json:"session_lifetime_secs"` + Address string `json:"address"` + AllowedOrigins []string `json:"allowed_origins"` + AllowHeaderPNA bool `json:"allow_header_pna"` } // DriverConfig contains config info specific to each wallet driver diff --git a/daemon/kmd/kmd.go b/daemon/kmd/kmd.go index 9f51eb7053..220dd8da5b 100644 --- a/daemon/kmd/kmd.go +++ b/daemon/kmd/kmd.go @@ -65,14 +65,14 @@ func Start(startConfig StartConfig) (died chan error, sock string, err error) { // Configure the wallet API server serverCfg := server.WalletServerConfig{ - APIToken: apiToken, - DataDir: startConfig.DataDir, - Address: kmdCfg.Address, - AllowedOrigins: kmdCfg.AllowedOrigins, - EnablePrivateNetworkAccessHeader: kmdCfg.EnablePrivateNetworkAccessHeader, - SessionManager: session.MakeManager(kmdCfg), - Log: startConfig.Log, - Timeout: startConfig.Timeout, + APIToken: apiToken, + DataDir: startConfig.DataDir, + Address: kmdCfg.Address, + AllowedOrigins: kmdCfg.AllowedOrigins, + AllowHeaderPNA: kmdCfg.AllowHeaderPNA, + SessionManager: session.MakeManager(kmdCfg), + Log: startConfig.Log, + Timeout: startConfig.Timeout, } // Instantiate the wallet API server diff --git a/daemon/kmd/server/server.go b/daemon/kmd/server/server.go index d167e75c98..58638f0bee 100644 --- a/daemon/kmd/server/server.go +++ b/daemon/kmd/server/server.go @@ -50,14 +50,14 @@ const ( // WalletServerConfig is the configuration passed to MakeWalletServer type WalletServerConfig struct { - APIToken string - DataDir string - Address string - AllowedOrigins []string - EnablePrivateNetworkAccessHeader bool - SessionManager *session.Manager - Log logging.Logger - Timeout *time.Duration + APIToken string + DataDir string + Address string + AllowedOrigins []string + AllowHeaderPNA bool + SessionManager *session.Manager + Log logging.Logger + Timeout *time.Duration } // WalletServer deals with serving API requests @@ -212,7 +212,7 @@ func (ws *WalletServer) start(kill chan os.Signal) (died chan error, sock string // Initialize HTTP server watchdogCB := ws.makeWatchdogCallback(kill) srv := http.Server{ - Handler: api.Handler(ws.SessionManager, ws.Log, ws.AllowedOrigins, ws.APIToken, ws.EnablePrivateNetworkAccessHeader, watchdogCB), + Handler: api.Handler(ws.SessionManager, ws.Log, ws.AllowedOrigins, ws.APIToken, ws.AllowHeaderPNA, watchdogCB), } // Read the kill channel and shut down the server gracefully