mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
fix: stricter RFC 3986 character set
This commit is contained in:
parent
7fe3bf5841
commit
e0227219f7
1 changed files with 18 additions and 3 deletions
|
|
@ -1,5 +1,20 @@
|
|||
use percent_encoding::{AsciiSet, NON_ALPHANUMERIC};
|
||||
use percent_encoding::{AsciiSet, CONTROLS};
|
||||
|
||||
// RFC 3986 path component: encode everything that is not a safe path character.
|
||||
pub const RFC_3986: &AsciiSet =
|
||||
&NON_ALPHANUMERIC.remove(b'-').remove(b'.').remove(b'_').remove(b'~');
|
||||
// Safe chars: unreserved (A-Za-z0-9 -._~) + sub-delims (!$&'()*+,;=) + : @ /
|
||||
pub const RFC_3986: &AsciiSet = &CONTROLS
|
||||
.add(b' ')
|
||||
.add(b'"')
|
||||
.add(b'#')
|
||||
.add(b'%')
|
||||
.add(b'<')
|
||||
.add(b'>')
|
||||
.add(b'?')
|
||||
.add(b'[')
|
||||
.add(b'\\')
|
||||
.add(b']')
|
||||
.add(b'^')
|
||||
.add(b'`')
|
||||
.add(b'{')
|
||||
.add(b'|')
|
||||
.add(b'}');
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue