add trusted proxy for parsing client IPs (#115)

This commit is contained in:
Tobi Smethurst 2021-07-26 16:15:36 +02:00 committed by GitHub
commit e2757ae676
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 339 additions and 13 deletions

View file

@ -11,6 +11,7 @@ func TestDefault() *Config {
Host: defaults.Host,
Protocol: defaults.Protocol,
Port: defaults.Port,
TrustedProxies: defaults.TrustedProxies,
SoftwareVersion: defaults.SoftwareVersion,
DBConfig: &DBConfig{
Type: defaults.DbType,
@ -77,6 +78,7 @@ func Default() *Config {
Host: defaults.Host,
Protocol: defaults.Protocol,
Port: defaults.Port,
TrustedProxies: defaults.TrustedProxies,
SoftwareVersion: defaults.SoftwareVersion,
DBConfig: &DBConfig{
Type: defaults.DbType,
@ -145,6 +147,7 @@ func GetDefaults() Defaults {
AccountDomain: "",
Protocol: "https",
Port: 8080,
TrustedProxies: []string{"127.0.0.1/32"}, // localhost
DbType: "postgres",
DbAddress: "localhost",
@ -204,6 +207,7 @@ func GetTestDefaults() Defaults {
AccountDomain: "",
Protocol: "http",
Port: 8080,
TrustedProxies: []string{"127.0.0.1/32"},
DbType: "postgres",
DbAddress: "localhost",