Skip to content

Commit

Permalink
Only display landing page on / (#261)
Browse files Browse the repository at this point in the history
Signed-off-by: Toon Schoenmakers <[email protected]>
Co-authored-by: Toon Schoenmakers <[email protected]>
  • Loading branch information
schoentoon and Toon Schoenmakers authored Oct 29, 2024
1 parent ad41e17 commit 1855ceb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions web/landing_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ func NewLandingPage(c LandingConfig) (*LandingPageHandler, error) {
}

func (h *LandingPageHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if r.URL.Path != "/" {
http.NotFound(w, r)
return
}
w.Header().Add("Content-Type", "text/html; charset=UTF-8")
w.Write(h.landingPage)
}

0 comments on commit 1855ceb

Please sign in to comment.