case strings.Contains(q, "config"): s.handleConfig(w, sess) case strings.Contains(q, "documents") || strings.Contains(q, "document"): s.handleDocuments(w, req, sess, store) default: writeJSON(w, `{"data":{"systemStatus":"OK"}}`) } } // ── Session helpers ─────────────────────────────────────────────────────────── func (s *Server) sessionFromRequest(r *http.Request) *auth.Session { raw := r.Header.Get("Authorization")