Spaces:
Runtime error
Runtime error
maokwen
commited on
Commit
β’
9f5213c
1
Parent(s):
4335749
π fix: explicit `content-type` header for the search page response (#458)
Browse files- 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()
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
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", "/"))
|