File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -54,10 +54,7 @@ fn error_to_html_string(app_state: &AppState, err: &anyhow::Error) -> anyhow::Re
5454
5555fn anyhow_err_to_actix_resp ( e : & anyhow:: Error , state : & AppState ) -> HttpResponse {
5656 let mut resp = HttpResponseBuilder :: new ( StatusCode :: INTERNAL_SERVER_ERROR ) ;
57- resp. insert_header ( (
58- header:: CONTENT_TYPE ,
59- header:: HeaderValue :: from_static ( "text/plain; charset=utf-8" ) ,
60- ) ) ;
57+ resp. insert_header ( ( header:: CONTENT_TYPE , header:: ContentType :: plaintext ( ) ) ) ;
6158
6259 if let Some ( status_err @ & ErrorWithStatus { .. } ) = e. downcast_ref ( ) {
6360 status_err. error_response ( )
@@ -72,10 +69,7 @@ fn anyhow_err_to_actix_resp(e: &anyhow::Error, state: &AppState) -> HttpResponse
7269 } else {
7370 match error_to_html_string ( state, e) {
7471 Ok ( body) => {
75- resp. insert_header ( (
76- header:: CONTENT_TYPE ,
77- header:: HeaderValue :: from_static ( "text/html; charset=utf-8" ) ,
78- ) ) ;
72+ resp. insert_header ( ( header:: CONTENT_TYPE , header:: ContentType :: html ( ) ) ) ;
7973 resp. body ( body)
8074 }
8175 Err ( second_err) => {
You can’t perform that action at this time.
0 commit comments