urlsplit manufactures hostnames because it strips off tabs before validating them
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 77.2k
- Fork
- 35.9k
- Metriche di merge delle PR
- Metriche PR in attesa
Descrizione
Bug report
Bug description:
import urllib.parse
# prints "abcxyz.test"
print(urllib.parse.urlsplit("http://abc\txyz.test/").netloc)
Current urlsplit is implemented according to this spec:
https://url.spec.whatwg.org/#concept-basic-url-parser
The spec does say in item 3 to strip tabs, but I believe there's a bug in the specification (perhaps they wanted to say leading/trailing whitespace) because the item 7 in host parsing says
If asciiDomain contains a forbidden domain code point, domain-invalid-code-point validation error, return failure.
, and tab is listed as a "forbidden domain code point". If tabs are stripped from the entire input before any other work is done, checking for tabs in host names wouldn't make much sense.
I created a bug in the specification project, so maybe they will provide some guidance later on.
https://github.com/whatwg/url/issues/829
CPython versions tested on:
3.10
Operating systems tested on:
Linux, Windows
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia dal punto di ingresso urllib.parse.urlsplit ed esegui il reproducer dell’issue per confermare in che modo un tab incorporato modifica il netloc. Leggi il WHATWG URL issue 829 collegato come riferimento per il conflitto nella specifica; il lavoro è completo quando i tab nel nome host non vengono trasformati silenziosamente in un nome host diverso.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- networking
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100