feat(config): allow invalid server filters (#2419)

- Disallow setting a server filter when there is no choice available
- Allow setting an invalid server filter when there is at least one choice available
- Log at warn level when an invalid server filter is set
- Fix #2337
This commit is contained in:
Quentin McGaw
2024-08-17 12:01:26 +02:00
committed by GitHub
parent 4a128677dd
commit 897a9d7f57
8 changed files with 68 additions and 26 deletions

View File

@@ -116,7 +116,7 @@ func (h *vpnHandler) patchSettings(w http.ResponseWriter, r *http.Request) {
updatedSettings := h.looper.GetSettings() // already copied
updatedSettings.OverrideWith(overrideSettings)
err = updatedSettings.Validate(h.storage, h.ipv6Supported)
err = updatedSettings.Validate(h.storage, h.ipv6Supported, h.warner)
if err != nil {
http.Error(w, err.Error(), http.StatusBadRequest)
return