Skip to content

feat: custom response body & headers for HTTP status injection - #2

Merged
achoimet merged 1 commit into
mainfrom
feat/http-abort-custom-response
Aug 28, 2026
Merged

achoimet merged 1 commit into
mainfrom
feat/http-abort-custom-response

Conversation

@achoimet

Copy link
Copy Markdown
Member

Extends the HTTP status-injection fault ("Intercept and Modify Response") so callers can return a custom body and custom headers — e.g. a JSON error payload or a Retry-After header — instead of the fixed plaintext body.

  • Fault/RuleDTO gain HTTPBody + HTTPHeaders; flags --fault-http-body and repeatable --fault-http-header 'Key: Value'.
  • Content-Length and Connection stay proxy-owned (correct framing); Content-Type defaults to text/plain but is overridable.
  • Cleartext HTTP only, same as the status code.
  • Tests cover default body, custom body/headers, and header canonicalization.

The HTTP abort fault synthesized a fixed body and Content-Type. Add optional
HTTPBody and HTTPHeaders to the rule/flags/config so callers can return a
custom body and headers (e.g. a JSON error or a Retry-After). Content-Length
and Connection stay proxy-owned; Content-Type defaults but is overridable.
Cleartext HTTP only, same as the status code.
@achoimet
achoimet merged commit e3119ef into main Aug 28, 2026
3 checks passed
@achoimet
achoimet deleted the feat/http-abort-custom-response branch August 28, 2026 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant