attempt at fixing confirmation emails by setting email headers, link for manual confirmation email and cut next release #29
2 changed files with 12 additions and 3 deletions
fix Content-Type header missing for some error pages
- also add changelog entry for previous commit
commit
287f598a6f
|
|
@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
### Fix
|
||||
- confirmation emails now set the UserAgent and Auto-Submitted headers
|
||||
- the error pages using the generic_error_handler now set the Content-Type header
|
||||
|
||||
## [0.2.0] (2022-06-09)
|
||||
|
||||
### Add
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use crate::auth::User;
|
||||
use crate::error::PresentationError;
|
||||
use crate::job_offers::error::SaveResponseError;
|
||||
use crate::route::LOGIN_ROUTE;
|
||||
use crate::route::{HTML_CONTENT, LOGIN_ROUTE};
|
||||
use crate::{route, ServerConfig};
|
||||
|
||||
use crate::route::job_offer::edit::EditResponseError;
|
||||
|
|
@ -16,7 +16,7 @@ use actix_web::middleware::ErrorHandlerResponse;
|
|||
use actix_web::web::Data;
|
||||
use actix_web::{HttpRequest, HttpResponse, ResponseError};
|
||||
use handlebars::Handlebars;
|
||||
use http::header::LOCATION;
|
||||
use http::header::{CONTENT_TYPE, LOCATION};
|
||||
use http::Method;
|
||||
use lettre::address::AddressError;
|
||||
use log::{error, warn};
|
||||
|
|
@ -54,9 +54,14 @@ pub(crate) fn generic_server_error_handler<B>(
|
|||
.render(template, &data)
|
||||
.map_err(PresentationError::Render)?;
|
||||
|
||||
let response = HttpResponse::with_body(res.status(), body)
|
||||
let mut response = HttpResponse::with_body(res.status(), body)
|
||||
.map_into_boxed_body()
|
||||
.map_into_right_body();
|
||||
|
||||
response
|
||||
.headers_mut()
|
||||
.insert(CONTENT_TYPE, HTML_CONTENT.clone());
|
||||
|
||||
let response = res.into_response(response);
|
||||
|
||||
Ok(ErrorHandlerResponse::Response(response))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue