Skip to content

encode path segment#1528

Merged
guitavano merged 1 commit intomainfrom
tavano/encode-path-segment
Feb 10, 2026
Merged

encode path segment#1528
guitavano merged 1 commit intomainfrom
tavano/encode-path-segment

Conversation

@guitavano
Copy link
Contributor

@guitavano guitavano commented Feb 10, 2026

Summary by cubic

Encode path parameters per segment to preserve forward slashes while still escaping special characters. Applies this to both single and array path params in createHttpClient, preventing over-encoding of “/” that broke API routes while keeping validation intact.

Written for commit c4eb778. Summary will update on new commits.

Summary by CodeRabbit

  • Refactor
    • Improved internal handling of HTTP path parameters for better robustness and consistency.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 10, 2026

📝 Walkthrough

Walkthrough

Internal refactoring of path encoding logic in utils/http.ts. Added a new helper function encodePathSegment() to encode path segments while preserving forward slashes, replacing direct encodeURIComponent calls for both array and single path parameter handling.

Changes

Cohort / File(s) Summary
Path Encoding Refactoring
utils/http.ts
Introduced encodePathSegment() helper function to standardize path segment encoding. Updated array path parameters and single path parameter handling to use this helper instead of direct encodeURIComponent calls, preserving validation and error handling behavior.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A little helper hops into place,
Encoding segments at a steady pace,
Forward slashes stay secure and true,
Path parameters get their proper due,
Cleaner code, the refactor's through! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The description lacks required template sections (What is this Contribution About, Issue Link, Loom Video, Demonstration Link) despite having an auto-generated summary. Fill out all required sections from the description template: add a clear contribution summary, link to the relevant issue, provide a Loom video, and include a demonstration link.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'encode path segment' directly reflects the main change: adding path segment encoding to preserve forward slashes in the HTTP utility.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch tavano/encode-path-segment

No actionable comments were generated in the recent review. 🎉


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 and usage tips.

@github-actions
Copy link
Contributor

Tagging Options

Should a new tag be published when this PR is merged?

  • 👍 for Patch 0.134.2 update
  • 🎉 for Minor 0.135.0 update
  • 🚀 for Major 1.0.0 update

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

@guitavano guitavano merged commit 276885e into main Feb 10, 2026
6 checks passed
@guitavano guitavano deleted the tavano/encode-path-segment branch February 10, 2026 18:36
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.

1 participant