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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user