[fix] SPA static file server
This commit is contained in:
parent
dd4e72a557
commit
5517b4ac60
1 changed files with 2 additions and 2 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue