1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//! URL escaping for build-time resolvers.
//!
//! `percent-encoding` does the work — it is already in the tree under `ureq`,
//! which does not re-export it. It began in `opys-java` and moved here when a
//! second resolver needed it: a GitLab project path travels as one segment,
//! `group%2Fname`.
use ;
/// `encodeURIComponent`'s unreserved set: `A-Za-z0-9-_.!~*'()`.
const URI_COMPONENT: &AsciiSet = &NON_ALPHANUMERIC
.remove
.remove
.remove
.remove
.remove
.remove
.remove
.remove
.remove;
/// Escape one path segment or query value, `encodeURIComponent`-style. Needed
/// wherever a caller's string reaches a URL: a Temurin release name like
/// `jdk-21.0.13+11` has to travel as `%2B`, or Adoptium reads it as a space
/// and the lookup misses.
/// Undo [`encode_uri_component`] on one path segment. A segment that does not
/// decode to UTF-8 is returned as it was written — it is somebody's file name,
/// and being wrong about its spelling is worse than leaving it escaped.