bugfix variable lookup path
This commit is contained in:
parent
45629a7bff
commit
7e0d7a1625
@ -5,6 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
"path"
|
||||||
)
|
)
|
||||||
|
|
||||||
type handler struct {
|
type handler struct {
|
||||||
@ -14,7 +15,8 @@ type handler struct {
|
|||||||
|
|
||||||
func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
reqPath := r.URL.Path
|
reqPath := r.URL.Path
|
||||||
f, err := h.staticFS.Open(fmt.Sprintf("ng-client/browser%s", reqPath))
|
lookupPath := path.Dir(h.indexPath)
|
||||||
|
f, err := h.staticFS.Open(fmt.Sprintf("%s%s", lookupPath, reqPath))
|
||||||
if f != nil {
|
if f != nil {
|
||||||
f.Close()
|
f.Close()
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user