Skip to content

Fix: Make Response body contract explicitly nullable#279

Merged
techmahedy merged 1 commit intodoppar:3.xfrom
techmahedy:techmahedy-3.x
May 6, 2026
Merged

Fix: Make Response body contract explicitly nullable#279
techmahedy merged 1 commit intodoppar:3.xfrom
techmahedy:techmahedy-3.x

Conversation

@techmahedy
Copy link
Copy Markdown
Member

The Response body contract now matches Doppar’s real runtime behavior.

What changed

  1. Updated Response::getBody() to return ?string
  2. Updated the Response facade annotation to reflect the nullable return type
  3. Added regression coverage for response preparation paths that intentionally clear the body

Why

Doppar already allows null response bodies:

Tests

Added focused response tests to verify:

  1. HEAD requests clear the body during prepare()
  2. empty responses clear the body during prepare()

@techmahedy techmahedy merged commit 9b2e358 into doppar:3.x May 6, 2026
27 checks passed
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