diff options
| author | AKP <abi@tdpain.net> | 2025-01-25 13:11:49 +0000 |
|---|---|---|
| committer | AKP <abi@tdpain.net> | 2025-01-25 13:11:49 +0000 |
| commit | 112c0777e8123c9af33c318045bb6527f7315bd0 (patch) | |
| tree | 77c005526474895e553e2690e94573f8beccafaf /walrss | |
| parent | e70a4c43cd2711e4b6457dda2c207ddf2d3cb586 (diff) | |
Make including contact information in the user agent optional
Diffstat (limited to 'walrss')
| -rw-r--r-- | walrss/internal/rss/processor.go | 9 | ||||
| -rw-r--r-- | walrss/internal/state/state.go | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/walrss/internal/rss/processor.go b/walrss/internal/rss/processor.go index 2518c5e..ab1b82c 100644 --- a/walrss/internal/rss/processor.go +++ b/walrss/internal/rss/processor.go @@ -42,7 +42,14 @@ func getUserAgent(st *state.State) string { } else if core.Version != "" { o += "/" + core.Version } - o += " (" + st.Config.Platform.ContactInformation + ", https://github.com/codemicro/walrss)" + + var parts []string + if st.Config.Platform.ContactInformation != "" { + parts = append(parts, st.Config.Platform.ContactInformation) + } + parts = append(parts, "https://github.com/codemicro/walrss") + + o += " (" + strings.Join(parts, ", ") + ")" ua.ua = o }) return ua.ua diff --git a/walrss/internal/state/state.go b/walrss/internal/state/state.go index a0d8183..5306503 100644 --- a/walrss/internal/state/state.go +++ b/walrss/internal/state/state.go @@ -36,7 +36,7 @@ type Config struct { Platform struct { DisableRegistration bool `fig:"disableRegistration"` DisableSecureCookies bool `fig:"disableSecureCookies"` - ContactInformation string `fig:"contactInformation" validate:"required"` + ContactInformation string `fig:"contactInformation"` } OIDC struct { Enable bool `fig:"enable"` |
