Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(http) dont drop numeric headers #17769

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cirospaciari
Copy link
Member

@cirospaciari cirospaciari commented Feb 27, 2025

What does this PR do?

Fix: #17764
Match node.js behavior for numbers

  • Documentation or TypeScript types (it's okay to leave the rest blank in this case)
  • Code changes

How did you verify your code works?

Test

@robobun
Copy link

robobun commented Feb 27, 2025

Updated 12:05 AM PT - Feb 28th, 2025

@Jarred-Sumner, your commit 35a87044a7c3616fa684362a7277a05de2148c17 passed in Build #12482! 🎉


🧪   try this PR locally:

bunx bun-pr 17769

@cirospaciari cirospaciari requested a review from Copilot February 27, 2025 19:10

Choose a reason for hiding this comment

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

PR Overview

This PR fixes #17764 by ensuring numeric header values are not dropped and are handled as strings, matching Node.js behavior.

  • Adds tests in node-http.test.ts to verify that both server and client correctly handle numeric header values.
  • Updates header manipulation methods in http.ts (for OutgoingMessage and ServerResponse) to convert numeric header values to strings before setting or appending them.

Reviewed Changes

File Description
test/js/node/http/node-http.test.ts Introduced tests verifying numeric header handling
src/js/node/http.ts Modified header methods to stringify numeric values

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

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.

OutgoingMessage.setHeader() silently drops number values
3 participants