Skip to content

Commit ff89897

Browse files
committed
feat: add coraza_is_response_body_processable() API
Expose IsResponseBodyProcessable() through the C API so connectors can skip response body processing when SecResponseBodyAccess is Off or the Content-Type doesn't match SecResponseBodyMimeType. Returns 1 if the body should be processed, 0 otherwise. Must be called after coraza_process_response_headers().
1 parent 627e13a commit ff89897

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

libcoraza/coraza.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,15 @@ func coraza_process_response_headers(t C.coraza_transaction_t, status C.int, pro
339339
return 0
340340
}
341341

342+
//export coraza_is_response_body_processable
343+
func coraza_is_response_body_processable(t C.coraza_transaction_t) C.int {
344+
tx := fromRaw[types.Transaction](t)
345+
if tx.IsResponseBodyProcessable() {
346+
return 1
347+
}
348+
return 0
349+
}
350+
342351
//export coraza_rules_count
343352
func coraza_rules_count(w C.coraza_waf_t) C.int {
344353
handle := fromRaw[*WafHandle](w)

0 commit comments

Comments
 (0)