commit 809baab415f7c2462a6cbaf3db303393cb7733f2
parent a415c3e1882767b12da854dd3dfa0b3286ef84a6
Author: David Eisinger <[email protected]>
Date: Tue, 7 Oct 2025 01:33:55 -0400
Fix trailing dot bug
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/internal/api.go b/internal/api.go
@@ -184,6 +184,12 @@ func NewHandlerWithConfig(db *DB, cfg HandlerConfig) (http.Handler, error) {
mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
p := strings.TrimPrefix(r.URL.Path, "/")
if p != "" {
+ // If the path is a single segment ending with a trailing dot, treat it
+ // as an invalid username route and return 404 instead of serving the SPA.
+ if !strings.Contains(p, "/") && strings.HasSuffix(p, ".") {
+ http.NotFound(w, r)
+ return
+ }
if strings.HasSuffix(p, ".json") || strings.HasSuffix(p, ".rss") {
// Extract username and format
format := "json"