fix: security hardening and HTTP status code corrections

- importSTRMHandler: add URL scheme validation (blocks file://, ftp://, etc.)
- backup Delete/Restore: harden path traversal check (block backslash, require .db extension)
- HTTP 201 for create endpoints: register, subscription, download client, notify channel, library, STRM import
- Error handling: return 500 for service/infra errors in download client and notify channel handlers

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
soldosluka857
2026-05-30 02:39:11 +00:00
committed by Shuke
parent 0572612833
commit e97891175a
7 changed files with 34 additions and 15 deletions
+1 -1
View File
@@ -58,7 +58,7 @@ func createLibraryHandler(svc *service.Container) gin.HandlerFunc {
svc.Audit.Record(c.Request.Context(), toString(uid), "library.create", l.ID, c.ClientIP(), l.Path)
// Refresh fsnotify watcher to pick up the new library root.
go func() { _ = svc.Watcher.Refresh(context.Background()) }()
c.JSON(http.StatusOK, l)
c.JSON(http.StatusCreated, l)
}
}