Fix search pages

This commit is contained in:
spikecodes 2021-01-02 22:37:54 -08:00
parent 5d26b5c764
commit a3384cbaa6
3 changed files with 33 additions and 18 deletions

View file

@ -97,7 +97,7 @@ pub struct ErrorTemplate {
// Grab a query param from a url
pub fn param(path: &str, value: &str) -> String {
let url = Url::parse(format!("https://reddit.com/{}", path).as_str()).unwrap();
let url = Url::parse(format!("https://libredd.it/{}", path).as_str()).unwrap();
let pairs: std::collections::HashMap<_, _> = url.query_pairs().into_owned().collect();
pairs.get(value).unwrap_or(&String::new()).to_owned()
}