fix: urlencoding is too precise, just replace %20
omg i really chose such a bad way to do this i need to pick a proper one
This commit is contained in:
parent
4aff505a16
commit
d5e01cc655
3 changed files with 4 additions and 5 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -4489,7 +4489,6 @@ dependencies = [
|
||||||
"tower-http",
|
"tower-http",
|
||||||
"tracing",
|
"tracing",
|
||||||
"tracing-subscriber",
|
"tracing-subscriber",
|
||||||
"url",
|
|
||||||
"uuid",
|
"uuid",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,6 @@ mdhtml = { path = "mdhtml", features = ["markdown"] }
|
||||||
jrd = "0.1"
|
jrd = "0.1"
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
tracing-subscriber = "0.3"
|
tracing-subscriber = "0.3"
|
||||||
url = "2.5"
|
|
||||||
clap = { version = "4.5", features = ["derive"] }
|
clap = { version = "4.5", features = ["derive"] }
|
||||||
futures = "0.3"
|
futures = "0.3"
|
||||||
tokio = { version = "1.35", features = ["full"] } # TODO slim this down
|
tokio = { version = "1.35", features = ["full"] } # TODO slim this down
|
||||||
|
|
|
@ -105,11 +105,12 @@ impl Context {
|
||||||
if id.starts_with("http") { // ready-to-use id
|
if id.starts_with("http") { // ready-to-use id
|
||||||
id
|
id
|
||||||
} else if id.starts_with('+') { // compacted id
|
} else if id.starts_with('+') { // compacted id
|
||||||
let reconstructed = id
|
// TODO theres already 2 edge cases, i really need to get rid of this
|
||||||
|
id
|
||||||
.replace('@', "/")
|
.replace('@', "/")
|
||||||
.replace("//", "/@") // oops my method sucks!! TODO
|
.replace("//", "/@") // oops my method sucks!! TODO
|
||||||
.replacen('+', "https://", 1);
|
.replacen('+', "https://", 1)
|
||||||
url::form_urlencoded::byte_serialize(reconstructed.as_bytes()).collect()
|
.replace(" ", "%20") // omg wordpress
|
||||||
} else { // bare local id
|
} else { // bare local id
|
||||||
format!("{}{}/{}/{}", self.0.protocol, self.0.domain, entity, id)
|
format!("{}{}/{}/{}", self.0.protocol, self.0.domain, entity, id)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue