Skip to content

Commit

Permalink
Fix TestParseSockaddrTemplate to take into account CustomResponseHead…
Browse files Browse the repository at this point in the history
…ers. (#12902)
  • Loading branch information
ncabatoff committed Oct 22, 2021
1 parent fd76783 commit bf9aa32
Showing 1 changed file with 26 additions and 25 deletions.
51 changes: 26 additions & 25 deletions command/server/config_test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"github.com/hashicorp/vault/internalshared/configutil"
)

var DefaultCustomHeaders = map[string]map[string]string {
var DefaultCustomHeaders = map[string]map[string]string{
"default": {
"Strict-Transport-Security": configutil.StrictTransportSecurity,
},
Expand All @@ -36,8 +36,8 @@ func testConfigRaftRetryJoin(t *testing.T) {
SharedConfig: &configutil.SharedConfig{
Listeners: []*configutil.Listener{
{
Type: "tcp",
Address: "127.0.0.1:8200",
Type: "tcp",
Address: "127.0.0.1:8200",
CustomResponseHeaders: DefaultCustomHeaders,
},
},
Expand Down Expand Up @@ -69,8 +69,8 @@ func testLoadConfigFile_topLevel(t *testing.T, entropy *configutil.Entropy) {
SharedConfig: &configutil.SharedConfig{
Listeners: []*configutil.Listener{
{
Type: "tcp",
Address: "127.0.0.1:443",
Type: "tcp",
Address: "127.0.0.1:443",
CustomResponseHeaders: DefaultCustomHeaders,
},
},
Expand Down Expand Up @@ -180,13 +180,13 @@ func testLoadConfigFile_json2(t *testing.T, entropy *configutil.Entropy) {
SharedConfig: &configutil.SharedConfig{
Listeners: []*configutil.Listener{
{
Type: "tcp",
Address: "127.0.0.1:443",
Type: "tcp",
Address: "127.0.0.1:443",
CustomResponseHeaders: DefaultCustomHeaders,
},
{
Type: "tcp",
Address: "127.0.0.1:444",
Type: "tcp",
Address: "127.0.0.1:444",
CustomResponseHeaders: DefaultCustomHeaders,
},
},
Expand Down Expand Up @@ -344,8 +344,8 @@ func testLoadConfigFileIntegerAndBooleanValuesCommon(t *testing.T, path string)
SharedConfig: &configutil.SharedConfig{
Listeners: []*configutil.Listener{
{
Type: "tcp",
Address: "127.0.0.1:8200",
Type: "tcp",
Address: "127.0.0.1:8200",
CustomResponseHeaders: DefaultCustomHeaders,
},
},
Expand Down Expand Up @@ -388,8 +388,8 @@ func testLoadConfigFile(t *testing.T) {
SharedConfig: &configutil.SharedConfig{
Listeners: []*configutil.Listener{
{
Type: "tcp",
Address: "127.0.0.1:443",
Type: "tcp",
Address: "127.0.0.1:443",
CustomResponseHeaders: DefaultCustomHeaders,
},
},
Expand Down Expand Up @@ -535,8 +535,8 @@ func testLoadConfigFile_json(t *testing.T) {
SharedConfig: &configutil.SharedConfig{
Listeners: []*configutil.Listener{
{
Type: "tcp",
Address: "127.0.0.1:443",
Type: "tcp",
Address: "127.0.0.1:443",
CustomResponseHeaders: DefaultCustomHeaders,
},
},
Expand Down Expand Up @@ -621,8 +621,8 @@ func testLoadConfigDir(t *testing.T) {

Listeners: []*configutil.Listener{
{
Type: "tcp",
Address: "127.0.0.1:443",
Type: "tcp",
Address: "127.0.0.1:443",
CustomResponseHeaders: DefaultCustomHeaders,
},
},
Expand Down Expand Up @@ -866,10 +866,11 @@ EOF
SharedConfig: &configutil.SharedConfig{
Listeners: []*configutil.Listener{
{
Type: "tcp",
Address: "127.0.0.1:443",
ClusterAddress: "127.0.0.1:8201",
TLSDisable: true,
Type: "tcp",
Address: "127.0.0.1:443",
ClusterAddress: "127.0.0.1:8201",
TLSDisable: true,
CustomResponseHeaders: DefaultCustomHeaders,
},
},
},
Expand All @@ -895,8 +896,8 @@ func testParseSeals(t *testing.T) {
SharedConfig: &configutil.SharedConfig{
Listeners: []*configutil.Listener{
{
Type: "tcp",
Address: "127.0.0.1:443",
Type: "tcp",
Address: "127.0.0.1:443",
CustomResponseHeaders: DefaultCustomHeaders,
},
},
Expand Down Expand Up @@ -949,8 +950,8 @@ func testLoadConfigFileLeaseMetrics(t *testing.T) {
SharedConfig: &configutil.SharedConfig{
Listeners: []*configutil.Listener{
{
Type: "tcp",
Address: "127.0.0.1:443",
Type: "tcp",
Address: "127.0.0.1:443",
CustomResponseHeaders: DefaultCustomHeaders,
},
},
Expand Down

0 comments on commit bf9aa32

Please sign in to comment.