You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(api): a mixed-case grace_period_days key merges instead of replacing #1658
PUT /api/config checks whether the body carries grace_period_days with an exact-case map lookup (internal/api/handler_config.go:75, present["grace_period_days"]). json.Unmarshal matches keys case-insensitively.
Failure scenario: a stored config has {"aws": 7, "azure": 3}, and a client sends {"Grace_Period_Days": {"aws": 5}}. The presence check misses the key, so the stored map is not reset (line 111). json.Unmarshal then merges into it, and the result is {"aws": 5, "azure": 3} instead of {"aws": 5}. The key the client dropped stays.
Impact is low: the frontend sends the exact key. Fix: detect the key with a case-insensitive check, like the one riExchangeModeSent uses (or the bodyHasKey helper from #1656 once it merges), and add a test with a mixed-case key.
Activity