mirror of
https://github.com/songquanpeng/one-api.git
synced 2026-02-04 13:15:56 +08:00
feat: allow baseUrl
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"github.com/gin-contrib/static"
|
||||
"io/fs"
|
||||
"net/http"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Credit: https://github.com/gin-contrib/static/issues/19
|
||||
@@ -14,7 +15,8 @@ type embedFileSystem struct {
|
||||
}
|
||||
|
||||
func (e embedFileSystem) Exists(prefix string, path string) bool {
|
||||
_, err := e.Open(path)
|
||||
relPath := strings.TrimPrefix(path, prefix)
|
||||
_, err := e.Open(relPath)
|
||||
return err == nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user