Skip to content

Commit

Permalink
Merge pull request #456 from trheyi/main
Browse files Browse the repository at this point in the history
[fix] the spa router length bug
  • Loading branch information
trheyi authored Sep 7, 2023
2 parents 30073f0 + 955920e commit abd21bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions service/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ func withStaticFileServer(c *gin.Context) {
}

// PWA app static file server
for root, length := range SpaRoots {
if length >= length && c.Request.URL.Path[0:length] == root {
for root, rootLength := range SpaRoots {
if rootLength >= length && c.Request.URL.Path[0:length] == root {
c.Request.URL.Path = strings.TrimPrefix(c.Request.URL.Path, root)
spaFileServers[root].ServeHTTP(c.Writer, c.Request)
c.Abort()
Expand Down

0 comments on commit abd21bd

Please sign in to comment.