Source Events ↗

plugins.request_short_circuited

A request hook returned an HTTP response.

When
request.intercept or middleware.inject returns REQUEST_RESPOND.
Payload
JSON: { phase, method, path, status }.
Cancelable
No

No downstream handler runs after this event.

Use cases

  • Custom auth
  • Maintenance responses

Example

Registration and handler

Register

hook!(host, PluginEvent::PluginRequestShortCircuited, on_short_circuit);

Handler

extern "C" fn on_event(ctx: *const EventContext) -> HookResult {
    let ctx = unsafe { &*ctx };
    let payload = unsafe { std::slice::from_raw_parts(ctx.payload_ptr, ctx.payload_len) };
    let _json = std::str::from_utf8(payload).unwrap_or_default();
    HookResult::r#continue()
}

← All lifecycle events