From 1b46a4c05c8d7db5b517061b5d46dc7327db7c98 Mon Sep 17 00:00:00 2001 From: Johann150 Date: Sat, 10 Jun 2023 15:21:55 +0200 Subject: [PATCH] blackhole favicon.ico requests It is not necessary to do anything for these kinds of requests, so instead of making the fuzzy search do stuff, just blackhole these requests. --- src/bahnhofname.gleam | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bahnhofname.gleam b/src/bahnhofname.gleam index 8ddb090..708aca6 100644 --- a/src/bahnhofname.gleam +++ b/src/bahnhofname.gleam @@ -128,6 +128,8 @@ fn lookup_station( fuzzy: fn (String) -> List(String) ) -> Response(BitBuilder) { let #(code, text) = case request { + // blackhole favicon.ico requests instead of using the index + Request(method: Get, path: "/favicon.ico", ..) -> #(404, "") Request(method: Get, path: "/help", ..) | Request(method: Get, path: "/", ..) -> #( 200,