Skip to content

Commit

Permalink
[fix] SPA static file server
Browse files Browse the repository at this point in the history
  • Loading branch information
trheyi committed Oct 11, 2023
1 parent dd4e72a commit 5517b4a
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 @@ -38,9 +38,9 @@ func withStaticFileServer(c *gin.Context) {
return
}

// PWA app static file server
// SPA app static file server
for root, rootLength := range SpaRoots {
if rootLength >= length && c.Request.URL.Path[0:length] == root {
if length >= rootLength && c.Request.URL.Path[0:rootLength] == 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 5517b4a

Please sign in to comment.