Percent encode URI for remote_interact
This commit is contained in:
parent
64d38c88e8
commit
bca870f1f8
@ -1,5 +1,6 @@
|
|||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
use heck::KebabCase;
|
use heck::KebabCase;
|
||||||
|
use rocket::http::uri::Uri;
|
||||||
use rocket::request::LenientForm;
|
use rocket::request::LenientForm;
|
||||||
use rocket::response::{Flash, Redirect};
|
use rocket::response::{Flash, Redirect};
|
||||||
use rocket_i18n::I18n;
|
use rocket_i18n::I18n;
|
||||||
@ -642,7 +643,7 @@ pub fn remote_interact_post(
|
|||||||
.and_then(|blog| Post::find_by_slug(&rockets.conn, &slug, blog.id))?;
|
.and_then(|blog| Post::find_by_slug(&rockets.conn, &slug, blog.id))?;
|
||||||
if let Some(uri) = User::fetch_remote_interact_uri(&remote.remote)
|
if let Some(uri) = User::fetch_remote_interact_uri(&remote.remote)
|
||||||
.ok()
|
.ok()
|
||||||
.map(|uri| uri.replace("{uri}", &target.ap_url))
|
.map(|uri| uri.replace("{uri}", &Uri::percent_encode(&target.ap_url)))
|
||||||
{
|
{
|
||||||
Ok(Redirect::to(uri).into())
|
Ok(Redirect::to(uri).into())
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user