mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-06 10:21:05 +02:00
config: strip quotes from http redirect addr (#818)
This commit is contained in:
parent
44784e98fe
commit
12e373249b
2 changed files with 12 additions and 0 deletions
|
@ -581,6 +581,9 @@ func (o *Options) Validate() error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// strip quotes from redirect address (#811)
|
||||||
|
o.HTTPRedirectAddr = strings.Trim(o.HTTPRedirectAddr, `"'`)
|
||||||
|
|
||||||
RedirectAndAutocertServer.update(o)
|
RedirectAndAutocertServer.update(o)
|
||||||
|
|
||||||
err = AutocertManager.update(o)
|
err = AutocertManager.update(o)
|
||||||
|
|
|
@ -13,6 +13,7 @@ import (
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
"github.com/google/go-cmp/cmp/cmpopts"
|
"github.com/google/go-cmp/cmp/cmpopts"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
var cmpOptIgnoreUnexported = cmpopts.IgnoreUnexported(Options{})
|
var cmpOptIgnoreUnexported = cmpopts.IgnoreUnexported(Options{})
|
||||||
|
@ -467,6 +468,14 @@ func TestOptions_sourceHostnames(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestHTTPRedirectAddressStripQuotes(t *testing.T) {
|
||||||
|
o := NewDefaultOptions()
|
||||||
|
o.InsecureServer = true
|
||||||
|
o.HTTPRedirectAddr = `":80"`
|
||||||
|
assert.NoError(t, o.Validate())
|
||||||
|
assert.Equal(t, ":80", o.HTTPRedirectAddr)
|
||||||
|
}
|
||||||
|
|
||||||
func TestCompareByteSliceSlice(t *testing.T) {
|
func TestCompareByteSliceSlice(t *testing.T) {
|
||||||
type Bytes = [][]byte
|
type Bytes = [][]byte
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue