Skip to content

Commit

Permalink
Fix 404 on refreshing routes that has ... in it (#628)
Browse files Browse the repository at this point in the history
  • Loading branch information
tan-nhu authored and Harness committed Sep 28, 2023
1 parent 812d1f6 commit 93845bc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion web/dist.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"os"
"path"
"path/filepath"
"strings"
"time"

"github.com/rs/zerolog/log"
Expand Down Expand Up @@ -55,7 +56,7 @@ func Handler() http.HandlerFunc {
// we need to always load the index.html file
// in the root of the project, unless the path
// points to a file with an extension (css, js, etc)
if filepath.Ext(r.URL.Path) == "" {
if filepath.Ext(r.URL.Path) == "" || strings.Contains(r.URL.Path, "...") {
// HACK: alter the path to point to the
// root of the project.
r.URL.Path = "/"
Expand Down

0 comments on commit 93845bc

Please sign in to comment.