can I just say that Windows paths annoy me?
This commit is contained in:
parent
b5437f35b6
commit
7f28c08c78
|
@ -10,7 +10,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func viewHandler(root string, w http.ResponseWriter, r *http.Request) {
|
func viewHandler(root string, w http.ResponseWriter, r *http.Request) {
|
||||||
file := filepath.Join(root, r.URL.Path[1:])
|
file := filepath.Join(root, filepath.FromSlash(r.URL.Path[1:]))
|
||||||
info, err := os.Stat(file)
|
info, err := os.Stat(file)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprint(w, err)
|
fmt.Fprint(w, err)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user