This commit is contained in:
lost+skunk 2024-11-15 22:43:27 +03:00
parent 191984b31e
commit 911923fde1
6 changed files with 16 additions and 10 deletions

View file

@ -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