diff options
| author | Jeff Carr <[email protected]> | 2024-01-12 16:04:08 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-12 16:04:08 -0600 |
| commit | 96cd3c3524bf34292970fa28f941334aa56d9c62 (patch) | |
| tree | 3a88f70b94f241116f8c8591190ac376f72ab504 /main.go | |
| parent | f47585ff550a058a025511a3235aad0d3ced3ccf (diff) | |
running at go.wit.com for the first time
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -11,17 +11,24 @@ import ( //go:embed files/* var htmlFiles embed.FS +// remove '?' part and trailing '/' +func cleanURL(url string) string { + url = "/" + strings.Trim(url, "/") + return url +} + func okHandler(w http.ResponseWriter, r *http.Request) { - // dumpClient(r) + dumpClient(r) var tmp string - tmp = r.URL.String() + // tmp = r.URL.String() + tmp = cleanURL(r.URL.Path) parts := strings.Split(tmp, "?") - log.Warn("client sent url =", tmp) - log.Warn("parts are:", parts) + log.Info("client sent url =", tmp) + log.Info("parts are:", parts) requrl := parts[0] url, repourl := findkey(requrl) - log.Warn("URL =", url, "REPO URL =", repourl, "REQUEST URL =", requrl) + log.Info("go.wit.com URL =", url, "REPO URL =", repourl, "REQUEST URL =", requrl) if repourl != "" { repoHTML(w, url, repourl) return |
