fix(samba): register /api/sharing/ on the mux, not the web switch

The /api/ subtree is routed on the main mux, so the browse case in the web
ServeHTTP switch was shadowed by the apiRouter catch-all and 401'd. Moved to
ServeSharingAPI behind RequireAuth+CsrfProtect, matching /api/storage/.
Found by live validation.
This commit is contained in:
2026-07-18 11:51:12 +02:00
parent 4f08e5e7c3
commit 2eef9b2e4a
3 changed files with 15 additions and 2 deletions
-2
View File
@@ -367,8 +367,6 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
s.sharingShareDeleteHandler(w, r)
case path == "/sharing/shares/offsite" && r.Method == http.MethodPost:
s.sharingShareOffsiteHandler(w, r)
case path == "/api/sharing/browse" && r.Method == http.MethodGet:
s.sharingBrowseHandler(w, r)
case path == "/settings/notifications" && r.Method == http.MethodGet:
s.settingsNotificationsPageHandler(w, r)
case path == "/settings/security" && r.Method == http.MethodGet: