lo48576 / iri-string

String types for URIs/IRIs.
Apache License 2.0
17 stars 3 forks source link

Recognize percent-encoded periods (`%2E`) during IRI resolution #9

Closed lo48576 closed 2 years ago

lo48576 commented 2 years ago

Period (.) is unreserved character, so %2E can be (and maybe should be?) decoded before performing remove_dot_segments, or at least recognized as a period.

$ cargo run --example resolve http://example.com/foo/ '%2E%2E'
    Finished dev [unoptimized + debuginfo] target(s) in 0.02s
     Running `target/debug/examples/resolve 'http://example.com/foo/' '%2E%2E'`
http://example.com/foo/%2E%2E
$

The expected result in the example above is http://example.com/.

lo48576 commented 2 years ago

Implemented and merged at e07c83e2d7e44b6f59903d62bcecc1e0a41bc3d9.