Skip to content

ci: test against multiple node versions - #476

Merged
v1rtl merged 4 commits into
tinyhttp:masterfrom
aldy505:ci/test-against-multiple-node-versions
Jan 20, 2026
Merged

v1rtl merged 4 commits into
tinyhttp:masterfrom
aldy505:ci/test-against-multiple-node-versions

Conversation

@aldy505

@aldy505 aldy505 commented Dec 30, 2025

Copy link
Copy Markdown
Member

We're testing against Node 20, which is on maintenance mode right now. Let's test against new versions as well.

Also pinned GHA versions to the commit hash (using actions-up).

Comment thread .github/workflows/main.yml Resolved
@socket-security

Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn Critical
Critical CVE: npm form-data uses unsafe random function in form-data for choosing boundary

CVE: GHSA-fjxv-7rqg-78g4 form-data uses unsafe random function in form-data for choosing boundary (CRITICAL)

Affected versions: < 2.5.4; >= 3.0.0 < 3.0.4; >= 4.0.0 < 4.0.4

Patched version: 4.0.4

From: pnpm-lock.yaml → npm/supertest-fetch@1.5.0 → npm/form-data@4.0.2

ℹ Read more on: This package | This alert | What is a critical CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known critical CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/form-data@4.0.2. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: npm safer-buffer is 94.0% likely obfuscated

Confidence: 0.94

Location: Package overview

From: ? → npm/safer-buffer@2.1.2

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/safer-buffer@2.1.2. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: npm vite is 91.0% likely obfuscated

Confidence: 0.91

Location: Package overview

From: package.json → npm/vite@7.1.11

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/vite@7.1.11. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@aldy505
aldy505 requested a review from v1rtl December 31, 2025 12:47
@v1rtl

v1rtl commented Jan 2, 2026

Copy link
Copy Markdown
Member

Can you make this PR into a single commit instead?

@v1rtl

v1rtl commented Jan 2, 2026

Copy link
Copy Markdown
Member

Also not sure why we gotta put pinned hashes

Do actions not follow semver?

@aldy505

aldy505 commented Jan 3, 2026

Copy link
Copy Markdown
Member Author

Can you make this PR into a single commit instead?

You can squash and merge this commit, doing a force push is a hassle.

Also not sure why we gotta put pinned hashes

Do actions not follow semver?

A good security practice that most people (security engineers) recently due.

@v1rtl
v1rtl merged commit 2799a2e into tinyhttp:master Jan 20, 2026
13 checks passed
v1rtl added a commit that referenced this pull request Jan 21, 2026
Node.js v24 introduces several breaking changes that affect tests:

1. Cache-Control headers: Node.js v24's fetch automatically adds
   'cache-control: no-cache' headers, preventing 304 Not Modified
   responses. Updated tests to explicitly set 'Cache-Control: max-age=3600'
   to allow conditional GET behavior.

2. IP/Hostname handling: Node.js v24 may connect via IPv6 (::1) even
   with Agent({ family: 4 }), and ignores custom Host headers for
   security. Updated tests to handle both IPv4 and IPv6 connections
   and accept 'localhost' hostname on v24+.

3. TRACE method: Node.js v24 blocks TRACE HTTP method for security
   (XST attack prevention). Added version check to skip test on v24+.

4. Host header validation: Node.js v24 has stricter validation for
   malformed headers. Updated tests to accept either 200 or 500
   status codes depending on Node.js version.

All changes maintain backward compatibility with Node.js v20 and v22
while supporting the new security-focused behavior in v24.

Fixes #476

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
v1rtl added a commit that referenced this pull request Jan 21, 2026
Node.js v24 introduces several breaking changes that affect tests:

1. Cache-Control headers: Node.js v24's fetch automatically adds
   'cache-control: no-cache' headers, preventing 304 Not Modified
   responses. Updated tests to explicitly set 'Cache-Control: max-age=3600'
   to allow conditional GET behavior.

2. IP/Hostname handling: Node.js v24 may connect via IPv6 (::1) even
   with Agent({ family: 4 }), and ignores custom Host headers for
   security. Updated tests to handle both IPv4 and IPv6 connections
   and accept 'localhost' hostname on v24+.

3. TRACE method: Node.js v24 blocks TRACE HTTP method for security
   (XST attack prevention). Added version check to skip test on v24+.

4. Host header validation: Node.js v24 has stricter validation for
   malformed headers. Updated tests to accept either 200 or 500
   status codes depending on Node.js version.

All changes maintain backward compatibility with Node.js v20 and v22
while supporting the new security-focused behavior in v24.

Fixes #476

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
v1rtl added a commit that referenced this pull request Feb 1, 2026
* docs: add CLAUDE.md for AI-assisted development

Add comprehensive documentation for Claude Code to understand:
- Common development commands (build, test, lint)
- High-level architecture (App class, Router, extensions)
- Project structure and monorepo layout
- Testing patterns and helpers
- Release process with changesets
- Code style and dependencies

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* chore: bump dev dependencies and configure workspace trust policy

Update development dependencies:
- @biomejs/biome: 2.2.4 → 2.3.7
- @commitlint/cli: 19.8.1 → 20.1.0
- @commitlint/config-conventional: 19.8.1 → 20.0.0
- @types/node: 22.10.7 → 24.10.1
- @vitest/coverage-v8: 3.2.4 → 4.0.13
- supertest-fetch: 1.5.0 → 2.0.0
- typescript: 5.9.2 → 5.9.3
- vite: 7.1.11 → 7.2.4
- vitest: 3.2.4 → 4.0.13

Add pnpm workspace trust policy configuration:
- Enable no-downgrade trust policy
- Set minimum release age to 24 hours
- Configure trust policy timeout

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* test: fix compatibility with Node.js v24

Node.js v24 introduces several breaking changes that affect tests:

1. Cache-Control headers: Node.js v24's fetch automatically adds
   'cache-control: no-cache' headers, preventing 304 Not Modified
   responses. Updated tests to explicitly set 'Cache-Control: max-age=3600'
   to allow conditional GET behavior.

2. IP/Hostname handling: Node.js v24 may connect via IPv6 (::1) even
   with Agent({ family: 4 }), and ignores custom Host headers for
   security. Updated tests to handle both IPv4 and IPv6 connections
   and accept 'localhost' hostname on v24+.

3. TRACE method: Node.js v24 blocks TRACE HTTP method for security
   (XST attack prevention). Added version check to skip test on v24+.

4. Host header validation: Node.js v24 has stricter validation for
   malformed headers. Updated tests to accept either 200 or 500
   status codes depending on Node.js version.

All changes maintain backward compatibility with Node.js v20 and v22
while supporting the new security-focused behavior in v24.

Fixes #476

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* test: fix compatibility with Node.js v24

Node.js v24 introduces several breaking changes that affect tests:

1. Cache-Control headers: Node.js v24's fetch automatically adds
   'cache-control: no-cache' headers, preventing 304 Not Modified
   responses. Updated tests to explicitly set 'Cache-Control: max-age=3600'
   to allow conditional GET behavior.

2. IP/Hostname handling: Node.js v24 may connect via IPv6 (::1) even
   with Agent({ family: 4 }), and ignores custom Host headers for
   security. Updated tests to handle both IPv4 and IPv6 connections
   and accept 'localhost' hostname on v24+.

3. TRACE method: Node.js v24 blocks TRACE HTTP method for security
   (XST attack prevention). Added version check to skip test on v24+.

4. Host header validation: Node.js v24 has stricter validation for
   malformed headers. Updated tests to accept either 200 or 500
   status codes depending on Node.js version.

All changes maintain backward compatibility with Node.js v20 and v22
while supporting the new security-focused behavior in v24.

Fixes #476

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* chore: fix biome check errors

- Update biome schema version from 2.2.4 to 2.3.7
- Ignore HTML template files with interpolation syntax
- Remove unused biome-ignore comment in firebase example
- Apply biome formatting to test files

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* chore: fix biome-ignore placeholder explanations

Replace <explanation> placeholders with actual descriptions for:
- jsonp: escape shadows global function
- cookie: RFC 7230 field-content regex
- content-disposition: RFC 5987/6266 parsing regexes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* ci: update Biome version to 2.3.7

Sync CI Biome version with package.json to fix check failures.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test: fix Node.js security backport compatibility

- Skip TRACE test (security restriction backported to Node 20.19+, 22.13+)
- Make hostname tests flexible for both old and new Host header behavior
- Make malformed host tests accept both behaviors

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
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.

2 participants