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
|
// PWA app static file server
|
||||||
for root, length := range SpaRoots {
|
for root, rootLength := range SpaRoots {
|
||||||
if length >= length && c.Request.URL.Path[0:length] == root {
|
if rootLength >= length && c.Request.URL.Path[0:length] == root {
|
||||||
c.Request.URL.Path = strings.TrimPrefix(c.Request.URL.Path, root)
|
c.Request.URL.Path = strings.TrimPrefix(c.Request.URL.Path, root)
|
||||||
spaFileServers[root].ServeHTTP(c.Writer, c.Request)
|
spaFileServers[root].ServeHTTP(c.Writer, c.Request)
|
||||||
c.Abort()
|
c.Abort()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue