fix: audit round 2 — session cookie Secure kondisional, logout clear cookie, IDOR report owner-scoping (migrasi 0008), health force login-gate, SSE stream login-gate, FE: Gate undefined-flicker, auth-expired global redirect, X-User-Key demo dihapus, error handling alerts/routines/watchlist, chart label, encodeURIComponent, Screener onMount
This commit is contained in:
@@ -8,9 +8,14 @@ import (
|
||||
)
|
||||
|
||||
// Health serves GET /api/health: last cycle time + credits spent today +
|
||||
// scheduler state + stale flags (docs/API.md).
|
||||
// scheduler state + stale flags (docs/API.md). force=1 runs a probe cycle —
|
||||
// only for logged-in users (anon force would burn Sectors credits = DoS).
|
||||
func (s *Server) Health(w http.ResponseWriter, r *http.Request) {
|
||||
if r.URL.Query().Get("force") == "1" {
|
||||
if _, ok := s.sessionUser(r); !ok {
|
||||
writeErr(w, http.StatusUnauthorized, "login dulu untuk memaksa siklus")
|
||||
return
|
||||
}
|
||||
_ = s.Sched.RunCycle(r.Context()) // synchronous probe cycle
|
||||
}
|
||||
lastCycle, schedOK := s.Sched.Status()
|
||||
|
||||
Reference in New Issue
Block a user