servo / servo/rust-url

Expose more parser configuration

Open
#667 8 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.6k
Forks
406
PR merge metrics
No merged PRs in 30d

Description

Currently the parser handles http/ftp/ws/wss/ftp/file in a special way without allowing to use the same behaviour for other URI schemes or to configure this in more detail.

For example https://github.com/servo/rust-url/blob/21aed6e18c129de019a4bf375f095231ef9daab3/url/src/parser.rs#L158-L180

or https://github.com/servo/rust-url/blob/21aed6e18c129de019a4bf375f095231ef9daab3/url/src/parser.rs#L1439

or https://github.com/servo/rust-url/blob/21aed6e18c129de019a4bf375f095231ef9daab3/url/src/parser.rs#L182-L189

.

Especially the HTTP behaviour to always have a / following the origin part (e.g. http://example.com?foo=bar is wrong but http://example.com/?foo=bar is correct) would be useful for many other schemes too.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the cited ranges in url/src/parser.rs, especially the scheme-specific handling around lines 1439 and 158-189. Trace how HTTP, FTP, WS, WSS, and FILE receive special treatment, then determine the configuration surface needed for other schemes. Done means callers can opt into equivalent behavior, including the required slash before a query, with tests covering the examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.