diff --git a/blog.go b/blog.go index 5b2dfca..7a9e62b 100644 --- a/blog.go +++ b/blog.go @@ -11,7 +11,7 @@ import ( ) const ( - blogTitle = "

%v

" + blogTitle = "

%v

" blogAuthor = "

By %v

" blogCreate = "
Written on: %v
" blogMain = "
%v
" diff --git a/internal/backend/count.go b/internal/backend/count.go index 212c7e5..1c77f08 100644 --- a/internal/backend/count.go +++ b/internal/backend/count.go @@ -39,6 +39,7 @@ func (b *Backend) countLog(w http.ResponseWriter, r *http.Request) { if r.URL.Query().Get("platform") != "" { //TODO: remove legacy code req.Platform = r.URL.Query().Get("platform") + req.ID = r.URL.Query().Get("id") } else { ReturnError(w, http.StatusBadRequest, "invalidBody", "Bad request") return diff --git a/main.go b/main.go index 0d3e787..1bb4e6f 100644 --- a/main.go +++ b/main.go @@ -103,8 +103,11 @@ func mainHandle(w http.ResponseWriter, r *http.Request) { if err == nil && !stat.IsDir() { http.ServeFile(w, r, filepath.Join(*webRoot, path)) return - } else if stat.IsDir() { - ind := filepath.Join(*webRoot, path, "index.html") + } + spl := strings.Split(path, "/") + stat, err = os.Stat(filepath.Join(*webRoot, spl[0])) + if stat.IsDir() { + ind := filepath.Join(*webRoot, spl[0], "index.html") stat, err = os.Stat(ind) if err == nil { http.ServeFile(w, r, ind)