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

Allow customizing header casing

Aperta
#670 2 commenti 7 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
rust

Direzione di ricerca

Inizia esaminando i tipi HeaderName e HeaderMap, quindi traccia il modo in cui i nomi degli header sono rappresentati nei valori http::Request e http::Response analizzati. Confronta le possibili modifiche all’API con il workaround esistente basato su extensions, indicato tramite hyper issue #2695; il lavoro sarà completato quando sarà disponibile un design documentato che supporti la personalizzazione delle maiuscole/minuscole per gli header inviati e l’ispezione delle maiuscole/minuscole dopo il parsing.

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

Descrizione

Currently, the http crate contains a HeaderName type that is used in the implementation of HeaderMap as the key type. This HeaderName type stores all header names as lower case (for performance reasons), such that it is impossible¹ to (a) send headers with custom casing for the name and to (b) inspect the casing of headers for a request or response that was parsed into http::Request<_> / http::Response<_>.

In theory this shouldn't matter, because HTTP header names are specified to be case-insensitive. However in practice there are unfortunately many non-compliant implementations that don't work if you don't use the casing they expect.

Would you consider changes to the http crate that allow representing case-sensitive header names? I don't particularily care whether this would be done through some change to the HeaderName type, adding generics in some place, or even something entirely different, but I'd be happy to talk through different approaches if there is a general interest in solving this at the http crate level.

¹ without hacks such as abusing request / response extensions to store information about the casing, which hyper optionally supports on top of the http crate, c.f. https://github.com/hyperium/hyper/issues/2695

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.