Skip to content

Commit

Permalink
Merge pull request #478 from trheyi/main
Browse files Browse the repository at this point in the history
[fix] SPA static file server
  • Loading branch information
trheyi authored Oct 11, 2023
2 parents 0a5ea25 + 5517b4a commit 680a8c1
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 680a8c1

Please sign in to comment.