fix(web): preserve aw_url when a settings POST omits it

A UI save was silently blanking the configured AW URL because
handlePostSettings bound the whole Settings from the request and saved
it as-is. Now reads s.settings.AWURL under the existing settingsMu lock
and carries it forward when req.AWURL is empty, so fields not exposed in
the form are never erased.
This commit is contained in:
2026-06-05 20:05:59 -04:00
parent bd2b8a41fd
commit c855731c39
2 changed files with 36 additions and 0 deletions
+5
View File
@@ -45,6 +45,11 @@ func (s *Server) handlePostSettings(c *gin.Context) {
s.settingsMu.Lock()
apply := s.applyFn
path := s.settingsPath
// aw_url is not exposed in the settings form; preserve the persisted value
// so a UI save never blanks a configured AW URL.
if req.AWURL == "" {
req.AWURL = s.settings.AWURL
}
s.settingsMu.Unlock()
if apply == nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": "settings not wired"})