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:
parent
9c42997209
commit
61bc012a62
4 changed files with 33 additions and 3 deletions
|
@ -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())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue