Skip to content

test: add regression test to ensure url embed preservation - #155

Merged
pi0 merged 1 commit into
unjs:mainfrom
SukkaW:path-regex-replace
Jul 3, 2026
Merged

pi0 merged 1 commit into
unjs:mainfrom
SukkaW:path-regex-replace

Conversation

@SukkaW

@SukkaW SukkaW commented Jul 3, 2026 •

Copy link
Copy Markdown
Member

A part of #2.

The http-party/node-http-proxy#1487 bug doesn't exist in httpxy. This is because the join URL method we are using is from @h3js, which is a proper implementation.

Since httpxy embed/inline the joinURL implementation from @h3js, the PR ports the corresponding regression test case to ensure this case is covered.

Summary by CodeRabbit

  • Tests
    • Added coverage to ensure generated outgoing paths keep embedded http:// and https:// segments intact within the incoming request path.

@SukkaW
SukkaW requested a review from pi0 July 3, 2026 07:23
@coderabbitai

coderabbitai Bot commented Jul 3, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Added a single test case to test/_utils.test.ts verifying that setupOutgoing preserves multiple embedded http:// and https:// substrings within the outgoing.path when the target base path ends with a slash.

Changes

setupOutgoing Path Preservation Test

Layer / File(s) Summary
Add path-preservation test case
test/_utils.test.ts
New #setupOutgoing test verifies outgoing.path retains multiple embedded http:// and https:// substrings unchanged.

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

Estimated code review effort

1 (Trivial) | ~3 minutes

Related Issues: None specified.

Related PRs: Ports a test case referenced from an upstream PR.

Suggested labels: tests

Suggested reviewers: None specified.

Poem

A path with http:// twice inside,
The rabbit checked it did not slide,
Slashes kept, and strings intact,
One small test to prove the fact,
Hop, commit, and merge with pride. 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the change: it adds a regression test for URL embed preservation.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.95%. Comparing base (c48bf65) to head (5d22891).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #155   +/-   ##
=======================================
  Coverage   94.95%   94.95%           
=======================================
  Files           8        8           
  Lines         793      793           
  Branches      328      328           
=======================================
  Hits          753      753           
  Misses         35       35           
  Partials        5        5           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pi0 pi0 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thnx!

@pi0
pi0 merged commit b9c8d50 into unjs:main Jul 3, 2026
4 checks passed
@SukkaW SukkaW mentioned this pull request Jul 3, 2026
21 of 58 tasks
@SukkaW
SukkaW deleted the path-regex-replace branch July 3, 2026 14:24
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