commit
680a8c169c
1 changed files with 2 additions and 2 deletions
|
|
@ -38,9 +38,9 @@ func withStaticFileServer(c *gin.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// PWA app static file server
|
// SPA app static file server
|
||||||
for root, rootLength := range SpaRoots {
|
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)
|
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