python-hyper / python-hyper/rfc3986
Resolution result is not consistent with RFC 3986 when the base has "rootless" path without authority
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 189
- Fork
- 38
- Merge medio
- 13h 36m
- PR unite (30g)
- 1
Descrizione
remove_dot_segments defined in RFC 3986 (section 5.2.4) sometimes add a leading slash when the base path is "rootless".
STEP OUTPUT BUFFER INPUT BUFFER
1 : foo/../baz
2E: foo /../baz
2C: /baz
2E: /baz
So, resolving ../baz against scheme:foo/bar should result in scheme:/baz.
However, output of this library differs from that.
$ python
Python 3.9.9 (main, Jan 10 2022, 18:52:39)
[GCC 11.2.1 20211127] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from rfc3986 import uri_reference
>>> b = uri_reference('scheme:foo/bar')
>>> r = uri_reference('../baz')
>>> t = r.resolve_with(b)
>>> t
URIReference(scheme='scheme', authority=None, path='baz', query=None, fragment=None)
>>> t.unsplit()
'scheme:baz'
>>>
I think there should be special handling such as "when .. segment appears but output stack is empty, set prepend_slash flag" or something like that.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
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 con le regole della sezione 5.2.4 di RFC 3986 e gli entry point uri_reference, resolve_with e remove_dot_segments. Riproduci l’esempio che risolve ../baz rispetto a scheme:foo/bar; il lavoro è completato quando il risultato viene ricomposto come scheme:/baz, preservando al contempo il comportamento di risoluzione esistente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- networking
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 48/100