1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-26 18:21:01 +00:00

Add support for HTTP Strict Transport Security header

This commit is contained in:
Frédéric Guillot 2018-02-03 15:54:02 -08:00
parent 9c42997209
commit 61bc012a62
4 changed files with 33 additions and 3 deletions

View file

@ -80,3 +80,22 @@ func TestDefaultBaseURL(t *testing.T) {
t.Fatalf(`Unexpected base path, got "%s"`, cfg.BasePath())
}
}
func TestHSTSOn(t *testing.T) {
os.Clearenv()
cfg := NewConfig()
if !cfg.HasHSTS() {
t.Fatalf(`Unexpected HSTS value, got "%v"`, cfg.HasHSTS())
}
}
func TestHSTSOff(t *testing.T) {
os.Clearenv()
os.Setenv("DISABLE_HSTS", "1")
cfg := NewConfig()
if cfg.HasHSTS() {
t.Fatalf(`Unexpected HSTS value, got "%v"`, cfg.HasHSTS())
}
}