From 7fc668d162e3457005440ddcfd21a07091547081 Mon Sep 17 00:00:00 2001 From: Brandon Liu Date: Thu, 11 Jan 2024 10:31:00 +0800 Subject: [PATCH] Make the root path / return a 204 (normal) status code instead of 404 [#115] (#116) --- pmtiles/server.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pmtiles/server.go b/pmtiles/server.go index 672206f..06857b9 100644 --- a/pmtiles/server.go +++ b/pmtiles/server.go @@ -389,5 +389,9 @@ func (server *Server) Get(ctx context.Context, path string) (int, map[string]str return server.get_metadata(ctx, http_headers, key) } - return 404, http_headers, []byte("Tile not found") + if path == "/" { + return 204, http_headers, []byte{} + } + + return 404, http_headers, []byte("Path not found") }