Merge pull request #456 from trheyi/main
[fix] the spa router length bug
This commit is contained in:
commit
abd21bd30c
1 changed files with 2 additions and 2 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue