mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 17:19:15 +08:00
feat: Add HSTS headers to response (#725)
This commit is contained in:
@ -153,8 +153,13 @@ impl From<ConfigError> for ApplicationError {
|
||||
}
|
||||
|
||||
fn error_response<T: Display>(err: &T) -> actix_web::HttpResponse {
|
||||
use actix_web::http::header;
|
||||
|
||||
use crate::consts;
|
||||
|
||||
actix_web::HttpResponse::BadRequest()
|
||||
.append_header(("Via", "Juspay_Router"))
|
||||
.append_header((header::STRICT_TRANSPORT_SECURITY, consts::HSTS_HEADER_VALUE))
|
||||
.append_header((header::VIA, "Juspay_Router"))
|
||||
.content_type("application/json")
|
||||
.body(format!(r#"{{ "error": {{ "message": "{err}" }} }}"#))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user