summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--files/repomap3
-rw-r--r--main.go15
-rw-r--r--repoHTML.go2
3 files changed, 14 insertions, 6 deletions
diff --git a/files/repomap b/files/repomap
index 6a74e52..b6ad3f2 100644
--- a/files/repomap
+++ b/files/repomap
@@ -25,4 +25,5 @@ go.wit.com/apps/go.wit.com git.wit.org/jcarr/go.wit.com
# Support packages
go.wit.com/dev/alexflint/go-arg/ git.wit.org/wit/go-arg
-go.wit.com/shell
+go.wit.com/shell git.wit.org/wit/shell
+go.wit.com/spew github.com/wit-go/spew
diff --git a/main.go b/main.go
index 01a7f70..9642cb9 100644
--- a/main.go
+++ b/main.go
@@ -5,19 +5,25 @@ import (
"go.wit.com/log"
"net/http"
"embed"
+ "strings"
)
//go:embed files/*
var htmlFiles embed.FS
func okHandler(w http.ResponseWriter, r *http.Request) {
- dumpClient(r)
+ // dumpClient(r)
var tmp string
tmp = r.URL.String()
- url, repourl := findkey(tmp)
- log.Info("url =", url, "repo url =", repourl)
+ parts := strings.Split(tmp, "?")
+ log.Warn("client sent url =", tmp)
+ log.Warn("parts are:", parts)
+ requrl := parts[0]
+
+ url, repourl := findkey(requrl)
+ log.Warn("URL =", url, "REPO URL =", repourl, "REQUEST URL =", requrl)
if repourl != "" {
- doGui(w, url, repourl)
+ repoHTML(w, url, repourl)
return
}
if tmp == "/" {
@@ -40,6 +46,7 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
findFile(w, "files/skeleton.v2.css")
return
}
+ log.Warn("BAD URL =", url, "REPO URL =", repourl)
fmt.Fprintln(w, "BAD", tmp)
}
diff --git a/repoHTML.go b/repoHTML.go
index f1426e5..0cba639 100644
--- a/repoHTML.go
+++ b/repoHTML.go
@@ -23,7 +23,7 @@ import (
</html>
*/
-func doGui(w http.ResponseWriter, gourl string, realurl string) {
+func repoHTML(w http.ResponseWriter, gourl string, realurl string) {
realurl = "https://" + realurl
log.Info("go repo =", gourl, "real url =", realurl)
fmt.Fprintln(w, "<!DOCTYPE html>")