From 2aa9a86e3d913fe12b7b682d7c7aead1765aab58 Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Thu, 8 Oct 2020 16:34:40 -0700 Subject: [PATCH] Allow non-root paths for index.html when returning server-rendered metadata page. Closes #227 --- controllers/index.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/index.go b/controllers/index.go index 26da643d4..d802d326b 100644 --- a/controllers/index.go +++ b/controllers/index.go @@ -30,7 +30,7 @@ type MetadataPage struct { func IndexHandler(w http.ResponseWriter, r *http.Request) { middleware.EnableCors(&w) - isIndexRequest := r.URL.Path == "/" || r.URL.Path == "/index.html" + isIndexRequest := r.URL.Path == "/" || filepath.Base(r.URL.Path) == "index.html" || filepath.Base(r.URL.Path) == "" // For search engine bots and social scrapers return a special // server-rendered page.