Skip to content

test(images): cover bodyless 304 content length - #1389

Merged
Wibias merged 1 commit into
devfrom
agent/test-bodyless-image-304
Aug 10, 2026
Merged

test(images): cover bodyless 304 content length#1389
Wibias merged 1 commit into
devfrom
agent/test-bodyless-image-304

Conversation

@Wibias

@Wibias Wibias commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add a focused regression for a bodyless HTTP 304 response that carries a representation Content-Length larger than the image relay cap.
  • Assert the bodyless response is treated as zero bytes and is not marked oversized.
  • Follow up on the review nit from fix(images): preserve bodyless responses with size headers #1386 with the standards-valid case that originally motivated the fix.

Why

#1386 correctly fixed bodyless responses before evaluating Content-Length, but its integration regression used 204 + Content-Length. A 304 response is the standards-valid case where Content-Length can describe the selected representation while the response itself has no body.

Scope

Test-only. No production behavior changes.

Validation

Summary by CodeRabbit

  • Bug Fixes

    • Corrected handling of bodyless 304 responses with oversized Content-Length headers.
    • These responses now correctly return zero bytes without being flagged as oversized.
  • Tests

    • Added coverage to verify the corrected response behavior.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ed45eee3-52c3-4690-ada1-710161c4243e

📥 Commits

Reviewing files that changed from the base of the PR and between fb2d2e6 and 76a8a17.

📒 Files selected for processing (1)
  • tests/server-images-bodyless-content-length.test.ts

📝 Walkthrough

Walkthrough

The change adds regression coverage for bodyless 304 image responses with an oversized Content-Length. The test verifies that readImageResponseBytes returns zero bytes and does not mark the response as oversized.

Changes

Bodyless response handling

Layer / File(s) Summary
Bodyless 304 regression coverage
tests/server-images-bodyless-content-length.test.ts
Adds a test that verifies an oversized Content-Length is ignored for a bodyless 304 image response. The response reports zero bytes and is not marked oversized.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

  • lidge-jun/opencodex#1386: Adds regression coverage for the same bodyless-response and oversized Content-Length behavior.

Suggested labels: review-ready

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the added test for bodyless 304 responses with an oversized Content-Length header.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/test-bodyless-image-304

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature). label Aug 10, 2026
@Wibias
Wibias marked this pull request as ready for review August 10, 2026 02:05

@Wibias Wibias left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the final head. No actionable findings.

The focused regression now covers the standards-valid case that motivated #1386: a bodyless HTTP 304 with a representation Content-Length above the image relay cap. It directly verifies readImageResponseBytes() treats the response as zero bytes and does not flag it as oversized. Scope is test-only, the PR is mergeable, and Cross-platform CI plus React Doctor are green.

From a code-review perspective, this is ready to merge.

@Wibias
Wibias merged commit 2314d9b into dev Aug 10, 2026
27 checks passed
@Wibias
Wibias deleted the agent/test-bodyless-image-304 branch August 10, 2026 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant