feat(handler/autologin): add favicon.ico and robots.txt to default ignorelist

This commit is contained in:
Trong Huu Nguyen
2022-09-09 13:09:36 +02:00
parent 7f93c62604
commit a4ceaeaacc

View File

@@ -8,6 +8,11 @@ import (
"github.com/nais/wonderwall/pkg/config"
)
var DefaultIgnorePatterns = []string{
"/favicon.ico",
"/robots.txt",
}
type AutoLogin struct {
Enabled bool
IgnorePatterns []string
@@ -37,7 +42,7 @@ func New(cfg *config.Config) (*AutoLogin, error) {
seen := make(map[string]bool)
patterns := make([]string, 0)
for _, path := range cfg.AutoLoginIgnorePaths {
for _, path := range append(DefaultIgnorePatterns, cfg.AutoLoginIgnorePaths...) {
if len(path) == 0 {
continue
}