attempt at fixing confirmation emails by setting email headers, link for manual confirmation email and cut next release #29

Merged
ben merged 8 commits from ben/Jobboerse:main into main 2022-06-10 15:36:51 +02:00
2 changed files with 12 additions and 3 deletions
Showing only changes of commit 287f598a6f - Show all commits

fix Content-Type header missing for some error pages

- also add changelog entry for previous commit
Bennet Bleßmann 2022-06-10 13:33:59 +02:00 committed by Bennet Bleßmann
Signed by: ben
GPG key ID: 3BE1A1A3CBC3CF99

View file

@ -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

View file

@ -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))