Skip to content

fix: preserve status message in gzip middleware#6663

Merged
chenjiahan merged 3 commits intomainfrom
codex/fix-bug-in-packages/core/src
Nov 30, 2025
Merged

fix: preserve status message in gzip middleware#6663
chenjiahan merged 3 commits intomainfrom
codex/fix-bug-in-packages/core/src

Conversation

@chenjiahan
Copy link
Copy Markdown
Member

Summary

  • preserve custom status messages when gzip middleware defers writeHead
  • ensure headers passed to writeHead are applied without misinterpreting status messages

Testing

  • pnpm lint

Codex Task

Copilot AI review requested due to automatic review settings November 28, 2025 23:11
@netlify
Copy link
Copy Markdown

netlify bot commented Nov 28, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 70b6ab4
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/692ae21589ee03000898c25a
😎 Deploy Preview https://deploy-preview-6663--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 56 (🔴 down 16 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug in the gzip middleware where custom HTTP status messages were being lost when the middleware deferred the writeHead call. The fix ensures that both the status code and the optional status message are preserved and properly applied.

Key changes:

  • Added writeHeadMessage variable to capture custom status messages
  • Updated writeHead override to correctly distinguish between the two signature overloads (with/without status message)
  • Modified the start function to pass the status message when calling the original writeHead

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chenjiahan chenjiahan merged commit c10a9d8 into main Nov 30, 2025
11 checks passed
@chenjiahan chenjiahan deleted the codex/fix-bug-in-packages/core/src branch November 30, 2025 01:05
@chenjiahan chenjiahan mentioned this pull request Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants