summaryrefslogtreecommitdiff
path: root/http.go
diff options
context:
space:
mode:
Diffstat (limited to 'http.go')
-rw-r--r--http.go16
1 files changed, 7 insertions, 9 deletions
diff --git a/http.go b/http.go
index 96a443a..fae1800 100644
--- a/http.go
+++ b/http.go
@@ -32,10 +32,10 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
log.Warn("forged REQUEST URL =", requrl, "msg =", len(msg))
if route == "/" {
- // indexHeader(w)
- // indexBodyStart(w)
- // indexBodyScanConfig(w)
- // indexDivEnd(w)
+ w.Header().Set("Content-Type", "text")
+ fmt.Fprintf(w, "go.wit.com/apps/utils/forged Version: %s\n", argv.Version())
+ fmt.Fprintf(w, "\n")
+ listPatchsets(w)
return
}
if route == "/patchset" {
@@ -58,6 +58,7 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
}
if route == "/goReference.svg" {
+ w.Header().Set("Content-Type", "image/svg+xml")
writeFile(w, "goReference.svg")
return
}
@@ -90,9 +91,6 @@ func writeFile(w http.ResponseWriter, filename string) {
var repohtml string
repohtml = string(pfile)
- if filename == "goReference.svg" {
- w.Header().Set("Content-Type", "image/svg+xml")
- }
fmt.Fprintln(w, repohtml)
log.Println("writeFile() found internal file:", filename)
}
@@ -105,9 +103,9 @@ func badurl(w http.ResponseWriter, badurl string) {
fmt.Fprintln(w, " </head>")
fmt.Fprintln(w, " <body>")
fmt.Fprintln(w, " IPv4 IS NOT SUPPORTED<br>")
- fmt.Fprintln(w, " MANY OF THESE REPOS REQUIRE IPv6.<br>")
+ fmt.Fprintln(w, " FORGE REQUIRES IPv6.<br>")
fmt.Fprintln(w, " <br>")
- fmt.Fprintln(w, " bad url", badurl, "<a href=\"https://go.wit.com/\">redirecting</a>")
+ fmt.Fprintln(w, " bad url", badurl, "<a href=\"https://forge.wit.com/\">redirecting</a>")
fmt.Fprintln(w, " </body>")
fmt.Fprintln(w, "</html>")
}