Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Request::connect can build an invalid Request object

Aperta
#494 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
rust
Ambito
networking

Direzione di ricerca

Inizia leggendo la documentazione di Request::connect e Uri::authority, quindi segui la chiamata a body() mostrata nell'esempio. Determina quale comportamento di RFC 2817 è previsto e verifica che la costruzione di una richiesta CONNECT non possa preservare un URI completo non valido.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

According to RFC2817, Section 5.2 the URI of the CONNECT method should be only the authority part:

A CONNECT method requests that a proxy establish a tunnel connection
on its behalf. The Request-URI portion of the Request-Line is always
an 'authority' as defined by URI Generic Syntax [2], which is to say
the host name and port number destination of the requested connection
separated by a colon:

However with the http 0.2.4 crate it is possible to create a CONNECT request with an invalid URI part.

Example:

use http::Request;
use http::Uri;

fn main() {
    let u: Uri = "http://example.org/index.html".parse().unwrap();
    let r = Request::connect(u).body(()).unwrap();
    dbg!(&r);
}

Output:

[src/main.rs:7] &r = Request {
    method: CONNECT,
    uri: http://example.org/index.html,
    version: HTTP/1.1,
    headers: {},
    body: (),
}

Rust Playground Link

Available options are:

Lingua principale
Rust
Stelle
1.4k
Fork
378
Merge medio
1g 21h
PR unite (30g)
5

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di hyperium/http

Tutte le issue di hyperium/http

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.