create & attach an AdHoc Fairing for dealing with Custom Domains

this rewrites the URL to /custom_domain/<url>
(we have no route handlers for this path yet)

Lots of help from @fdb-hiroshima & @BaptisteGelez in dealing with the
borrow checker — thank you 💜
This commit is contained in:
Igor Galić
2019-05-26 11:59:53 +02:00
committed by Igor Galić
parent 351c01f71c
commit 3a4c2f2cf9
2 changed files with 18 additions and 3 deletions
+7
View File
@@ -25,6 +25,7 @@ use posts::Post;
use safe_string::SafeString;
use schema::blogs;
use search::Searcher;
use std::fmt::{self, Display};
use users::User;
use {Connection, Error, PlumeRocket, Result};
@@ -39,6 +40,12 @@ impl Host {
}
}
impl Display for Host {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.0)
}
}
impl AsRef<str> for Host {
fn as_ref(&self) -> &str {
&self.0