From 911923fde11ed1e0efbc56f851f9b50e5e48665d Mon Sep 17 00:00:00 2001 From: lost+skunk Date: Fri, 15 Nov 2024 22:43:27 +0300 Subject: ы MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/parsers.go | 2 +- app/router.go | 9 +++++---- app/util.go | 3 ++- 3 files changed, 8 insertions(+), 6 deletions(-) (limited to 'app') diff --git a/app/parsers.go b/app/parsers.go index b7f15fd..192a88d 100644 --- a/app/parsers.go +++ b/app/parsers.go @@ -46,7 +46,7 @@ func (s skunkyart) ParseComments(c devianter.Comments, daError devianter.Error) if x.Parent > 0 { cmmts.WriteString(` In reply to `) diff --git a/app/router.go b/app/router.go index eddf0a9..c7dd623 100644 --- a/app/router.go +++ b/app/router.go @@ -9,7 +9,9 @@ import ( "strings" ) -var Host, Path string +var Host string + +// var Path *string func Router() { parsepath := func(path string) map[int]string { @@ -54,15 +56,14 @@ func Router() { // функция, что управляет всем handle := func(w http.ResponseWriter, r *http.Request) { - Path = r.URL.Path - path := parsepath(Path) + path := parsepath(r.URL.Path) Host = "http://" + r.Host - if h := r.Header["X-Forwarded-Proto"]; len(h) != 0 && h[0] == "https" { Host = "https://" + r.Host } var skunky = skunkyart{Version: Release.Version} + skunky._pth = r.URL.Path skunky.Args = r.URL.Query() arg := skunky.Args.Get diff --git a/app/util.go b/app/util.go index 9c8d400..6ece2e8 100644 --- a/app/util.go +++ b/app/util.go @@ -63,6 +63,7 @@ type instanceAbout struct { type skunkyart struct { Writer http.ResponseWriter + _pth string Args url.Values Page int @@ -274,7 +275,7 @@ func (s skunkyart) NavBase(c DeviationList) string { prevrev := func(msg string, page int, onpage bool) { if !onpage { list.WriteString(`