refactor: unify internal api authentication

This commit is contained in:
richjohnrambo
2026-09-21 23:08:15 +08:00
parent 186cfa21c8
commit dc36ce292e
3 changed files with 36 additions and 30 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ func serveInternalCultivate(w http.ResponseWriter, r *http.Request, prefix strin
writeIMError(w, r, http.StatusMethodNotAllowed, 30002, imReasonMethodNotAllowed, "method not allowed", nil)
return
}
if !authorizeInternalAPI(w, r, internalCapabilityCultivate) {
if !authorizeInternalAPI(w, r) {
return
}
parts := splitInternalPath(strings.Trim(strings.TrimPrefix(r.URL.Path, prefix), "/"))