maokwen commited on
Commit
9f5213c
β€’
1 Parent(s): 4335749

πŸ› fix: explicit `content-type` header for the search page response (#458)

Browse files
Files changed (1) hide show
  1. src/server/routes/search.rs +12 -10
src/server/routes/search.rs CHANGED
@@ -68,16 +68,18 @@ pub async fn search(
68
  get_results(page + 1)
69
  );
70
 
71
- Ok(HttpResponse::Ok().body(
72
- crate::templates::views::search::search(
73
- &config.style.colorscheme,
74
- &config.style.theme,
75
- &config.style.animation,
76
- query,
77
- &results?,
78
- )
79
- .0,
80
- ))
 
 
81
  }
82
  None => Ok(HttpResponse::TemporaryRedirect()
83
  .insert_header(("location", "/"))
 
68
  get_results(page + 1)
69
  );
70
 
71
+ Ok(HttpResponse::Ok()
72
+ .content_type("text/html; charset=utf-8")
73
+ .body(
74
+ crate::templates::views::search::search(
75
+ &config.style.colorscheme,
76
+ &config.style.theme,
77
+ &config.style.animation,
78
+ query,
79
+ &results?,
80
+ )
81
+ .0,
82
+ ))
83
  }
84
  None => Ok(HttpResponse::TemporaryRedirect()
85
  .insert_header(("location", "/"))