Skip to content

Preserve special characters in browser file paths - #24

Merged
Project516 merged 1 commit into
masterfrom
p516/http-file-paths
Nov 3, 2026
Merged

Project516 merged 1 commit into
masterfrom
p516/http-file-paths

Conversation

@Project516

Copy link
Copy Markdown
Owner

Browser file reads treat # and ? in filenames as URL delimiters, so paths such as /app/a#b.txt request the wrong resource. Encode each path segment for whole-file, metadata and range requests while preserving directory separators.

The regression test covers metadata, whole-file reads and range reads for filenames containing #, ?, literal percent sequences, Unicode and backslashes.

Validation: the new test failed before the fix and passes after it; TypeScript typecheck passed.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 32 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 9b94c136-58cc-4f17-9860-6e6f1de31806
Commits

Reviewing files that changed from the base of the PR and between 865a77f and c809398.

Files selected for processing: 2
  • src/browser/http.ts
  • test/http-files.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@project516-review-bot project516-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The PR replaces encodeURI with a custom encodePath that splits the path on /, applies encodeURIComponent to each segment, and rejoins. This correctly encodes #, ?, and other reserved characters in filenames while preserving directory separators. The change covers whole-file reads, range reads, and (via the shared request method) metadata requests. A new regression test exercises #, ?, literal % sequences, Unicode, and backslashes.


review-bot, model nvidia/nemotron-3-ultra-550b-a55b:free, verdict approve

Comment thread test/http-files.test.ts Resolved
@Project516
Project516 merged commit 608479d into master Nov 3, 2026
12 checks passed
@Project516
Project516 deleted the p516/http-file-paths branch November 3, 2026 01:48
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

⌂ Proxy