CustomDomainFairing must not match /static/ and /api/

thanks, again, @fdb-hiroshima for helping with this code, when i got
stuck in lifetime-hecc.
This commit is contained in:
Igor Galić 2019-05-27 17:54:16 +02:00 committed by Igor Galić
parent f94b0c79c5
commit 0645f7e253
No known key found for this signature in database
GPG Key ID: ACFEFF7F6A123A86

View File

@ -181,7 +181,14 @@ Then try to restart Plume
let custom_domain_fairing = AdHoc::on_request("Custom Blog Domains", |req, _data| {
let host = req.guard::<Host>();
if host.is_success() {
if host.is_success()
&& req
.uri()
.segments()
.next()
.map(|path| path != "static" && path != "api")
.unwrap_or(true)
{
let rewrite_uri = format!("/custom_domains/{}/{}", host.unwrap(), req.uri());
let uri = Origin::parse_owned(rewrite_uri).unwrap();
let uri = uri.to_normalized().into_owned();