ignore case on header keys

This commit is contained in:
ari melody 2025-06-16 19:50:48 +01:00
parent d2fb78108e
commit fc064efb61
Signed by: ari
GPG key ID: CF99829C92678188
2 changed files with 6 additions and 7 deletions

View file

@ -81,7 +81,7 @@ env!("CARGO_PKG_VERSION"));
}
if request.path() == "/" {
if request.headers().get("Accept").is_some_and(
if request.headers().get("accept").is_some_and(
|accept| accept.contains("text/html")
) {
// HTML response
@ -136,7 +136,7 @@ env!("CARGO_PKG_VERSION"));
let response_content = content
.replace("{{response}}", &query_response)
.replace("{{host}}", match request.headers().get("Host") {
.replace("{{host}}", match request.headers().get("host") {
Some(host) => { host }
None => { "mcq.bliss.town" }
});