http-rs / http-rs/surf

Mandatory base URL support in config

Open
#342 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
1.5k
Forks
128
PR merge metrics
No merged PRs in 30d

Description

I'd like to set a flag in Config that forces the resulting Client to *only* use URIs relative to the specified base URI, and never support absolute URIs.

This would add security when providing authentication: the config could `add_header` a header containing authentication information, and also set a mandatory base URI to ensure that the Client can't accidentally pass that authentication information to any other domain.

Contributor guide

Open the contributing guide

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 by tracing how Config creates and configures Client, then find where URI resolution permits absolute URIs. Define the behavior for a mandatory base URI and verify that relative requests still work while absolute requests are rejected, preventing configured authentication headers from being sent to another domain.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.