~jplatte/turbo.fish

1d66cd677b376e63831cb7f09873a796e251d993 — Ruben Schmidmeister 2 years ago 54389aa
Fix endless redirects for /random in Safari
1 files changed, 6 insertions(+), 1 deletions(-)

M src/main.rs
M src/main.rs => src/main.rs +6 -1
@@ 27,7 27,12 @@ fn index() -> Template {

#[get("/random")]
fn random() -> Redirect {
    Redirect::to(&URI::percent_encode(&format!("::<{}>", random_type())))
    // Safari doesn't seem to like redirect URLs starting with ::
    // the leading / is here to fix that.
    Redirect::to(&format!(
        "/{}",
        URI::percent_encode(&format!("::<{}>", random_type()))
    ))
}

#[get("/<turbofish>")]