mirror of
https://github.com/dcarrillo/whatismyip.git
synced 2025-07-04 09:19:25 +00:00
Add optional secure headers to responses
This commit is contained in:
@ -70,12 +70,13 @@ func TestParseFlags(t *testing.T) {
|
||||
City: "/city-path",
|
||||
ASN: "/asn-path",
|
||||
},
|
||||
TemplatePath: "",
|
||||
BindAddress: ":8080",
|
||||
TLSAddress: "",
|
||||
TLSCrtPath: "",
|
||||
TLSKeyPath: "",
|
||||
TrustedHeader: "",
|
||||
TemplatePath: "",
|
||||
BindAddress: ":8080",
|
||||
TLSAddress: "",
|
||||
TLSCrtPath: "",
|
||||
TLSKeyPath: "",
|
||||
TrustedHeader: "",
|
||||
EnableSecureHeaders: false,
|
||||
Server: serverSettings{
|
||||
ReadTimeout: 10 * time.Second,
|
||||
WriteTimeout: 10 * time.Second,
|
||||
@ -89,12 +90,13 @@ func TestParseFlags(t *testing.T) {
|
||||
City: "/city-path",
|
||||
ASN: "/asn-path",
|
||||
},
|
||||
TemplatePath: "",
|
||||
BindAddress: ":8001",
|
||||
TLSAddress: "",
|
||||
TLSCrtPath: "",
|
||||
TLSKeyPath: "",
|
||||
TrustedHeader: "",
|
||||
TemplatePath: "",
|
||||
BindAddress: ":8001",
|
||||
TLSAddress: "",
|
||||
TLSCrtPath: "",
|
||||
TLSKeyPath: "",
|
||||
TrustedHeader: "",
|
||||
EnableSecureHeaders: false,
|
||||
Server: serverSettings{
|
||||
ReadTimeout: 10 * time.Second,
|
||||
WriteTimeout: 10 * time.Second,
|
||||
@ -111,12 +113,13 @@ func TestParseFlags(t *testing.T) {
|
||||
City: "/city-path",
|
||||
ASN: "/asn-path",
|
||||
},
|
||||
TemplatePath: "",
|
||||
BindAddress: ":8080",
|
||||
TLSAddress: ":9000",
|
||||
TLSCrtPath: "/crt-path",
|
||||
TLSKeyPath: "/key-path",
|
||||
TrustedHeader: "",
|
||||
TemplatePath: "",
|
||||
BindAddress: ":8080",
|
||||
TLSAddress: ":9000",
|
||||
TLSCrtPath: "/crt-path",
|
||||
TLSKeyPath: "/key-path",
|
||||
TrustedHeader: "",
|
||||
EnableSecureHeaders: false,
|
||||
Server: serverSettings{
|
||||
ReadTimeout: 10 * time.Second,
|
||||
WriteTimeout: 10 * time.Second,
|
||||
@ -126,19 +129,20 @@ func TestParseFlags(t *testing.T) {
|
||||
{
|
||||
[]string{
|
||||
"-geoip2-city", "/city-path", "-geoip2-asn", "/asn-path",
|
||||
"-trusted-header", "header",
|
||||
"-trusted-header", "header", "-enable-secure-headers",
|
||||
},
|
||||
settings{
|
||||
GeodbPath: geodbPath{
|
||||
City: "/city-path",
|
||||
ASN: "/asn-path",
|
||||
},
|
||||
TemplatePath: "",
|
||||
BindAddress: ":8080",
|
||||
TLSAddress: "",
|
||||
TLSCrtPath: "",
|
||||
TLSKeyPath: "",
|
||||
TrustedHeader: "header",
|
||||
TemplatePath: "",
|
||||
BindAddress: ":8080",
|
||||
TLSAddress: "",
|
||||
TLSCrtPath: "",
|
||||
TLSKeyPath: "",
|
||||
TrustedHeader: "header",
|
||||
EnableSecureHeaders: true,
|
||||
Server: serverSettings{
|
||||
ReadTimeout: 10 * time.Second,
|
||||
WriteTimeout: 10 * time.Second,
|
||||
|
Reference in New Issue
Block a user