do redirects using http 301
actix will instead use http 308, which is technically the more correct, modern way to do this. but http 308 isn't understood by some old browsers. today, 99.9% of people wouldn't care about that. but i do.
This commit is contained in:
parent
d98cef8af9
commit
7c1d42f870
|
@ -3,6 +3,7 @@ use std::ops::Deref;
|
|||
use std::path::PathBuf;
|
||||
use std::sync::RwLock;
|
||||
|
||||
use actix_web::http::StatusCode;
|
||||
use actix_web::web::Redirect;
|
||||
use actix_web::{Either, HttpRequest, HttpResponse};
|
||||
use chrono::{Datelike, TimeZone};
|
||||
|
@ -426,7 +427,7 @@ impl SiteService {
|
|||
}
|
||||
Some(Content::Redirect(url)) => {
|
||||
log::debug!("Found redirect at {}", req.path());
|
||||
Some(Either::Right(Redirect::to(url).permanent()))
|
||||
Some(Either::Right(Redirect::to(url).using_status_code(StatusCode::MOVED_PERMANENTLY)))
|
||||
}
|
||||
None => {
|
||||
log::debug!("No matching content at {}", req.path());
|
||||
|
|
Loading…
Reference in a new issue