Problem
adapt() only returns 204 No Content when data == nil. If a DELETE handler accidentally returns data, it gets a 200 OK response. The docs say DELETE → 204, but this is not enforced.
// core/controller.go — adapt()
if data == nil {
w.WriteHeader(http.StatusNoContent) // 204
return
}
status := http.StatusOK // DELETE with data → 200 ← wrong
if method == "POST" {
status = http.StatusCreated
}
Impact
- Inconsistent behaviour: DELETE handlers that return data get 200 instead of 204
- Silent mismatch between documentation and actual behaviour
Proposed Fix
Force 204 for DELETE regardless of returned data:
if data == nil || method == "DELETE" {
w.WriteHeader(http.StatusNoContent)
return
}
Environment
- File:
core/controller.go:202
Problem
adapt()only returns 204 No Content whendata == nil. If a DELETE handler accidentally returns data, it gets a 200 OK response. The docs say DELETE → 204, but this is not enforced.Impact
Proposed Fix
Force 204 for DELETE regardless of returned data:
Environment
core/controller.go:202