feat: Add HSTS headers to response (#725)

This commit is contained in:
Kartikeya Hegde
2023-03-10 14:49:58 +05:30
committed by GitHub
parent c085e460be
commit 7ed665ecec
7 changed files with 34 additions and 13 deletions

View File

@ -57,8 +57,11 @@ pub mod error_parser {
fn error_response(&self) -> actix_web::HttpResponse<actix_web::body::BoxBody> {
use actix_web::http::header;
use crate::consts;
actix_web::HttpResponseBuilder::new(StatusCode::BAD_REQUEST)
.insert_header((header::CONTENT_TYPE, mime::APPLICATION_JSON))
.insert_header((header::STRICT_TRANSPORT_SECURITY, consts::HSTS_HEADER_VALUE))
.insert_header((header::VIA, "Juspay_Router"))
.body(self.to_string())
}