Implement 'posts hidden because of NSFW'. (Resolves #159) (#619)

This commit is contained in:
Daniel Valentine 2022-11-07 20:54:49 -07:00 committed by GitHub
parent 5c366e14a3
commit 465d9b7ba7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 30 additions and 9 deletions

View file

@ -46,11 +46,7 @@ pub async fn canonical_path(path: String) -> Result<Option<String>, String> {
res
.headers()
.get(header::LOCATION)
.map(|val| percent_encode(val.as_bytes(), CONTROLS)
.to_string()
.trim_start_matches(REDDIT_URL_BASE)
.to_string()
),
.map(|val| percent_encode(val.as_bytes(), CONTROLS).to_string().trim_start_matches(REDDIT_URL_BASE).to_string()),
)
}