diff options
| author | Jeff Carr <[email protected]> | 2024-01-12 17:38:05 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-12 17:38:05 -0600 |
| commit | 46959efd7beedde1585305d3d0cf2e6c127f3417 (patch) | |
| tree | 661ba448ee744055377c3fe82a172b6cac0993c1 | |
| parent | 96cd3c3524bf34292970fa28f941334aa56d9c62 (diff) | |
refresh bad urls to git.wit.org
Signed-off-by: Jeff Carr <[email protected]>
| -rw-r--r-- | files/refresh.html | 9 | ||||
| -rw-r--r-- | files/repomap | 3 | ||||
| -rw-r--r-- | main.go | 18 |
3 files changed, 28 insertions, 2 deletions
diff --git a/files/refresh.html b/files/refresh.html new file mode 100644 index 0000000..baf2c02 --- /dev/null +++ b/files/refresh.html @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html> + <head> + <meta http-equiv="refresh" content="0; url=https://go.wit.com/"> + </head> + <body> + BAD URL <a href="https://go.wit.com/">redirecting back to go.wit.com</a> + </body> +</html> diff --git a/files/repomap b/files/repomap index b6ad3f2..d35d3f7 100644 --- a/files/repomap +++ b/files/repomap @@ -24,6 +24,7 @@ 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/arg git.wit.org/wit/arg +go.wit.com/dev/alexflint/go-arg git.wit.org/wit/arg go.wit.com/shell git.wit.org/wit/shell go.wit.com/spew github.com/wit-go/spew @@ -54,7 +54,8 @@ func okHandler(w http.ResponseWriter, r *http.Request) { return } log.Warn("BAD URL =", url, "REPO URL =", repourl) - fmt.Fprintln(w, "BAD", tmp) + badurl(w, r.URL.String()) + // fmt.Fprintln(w, "BAD", tmp) } func findFile(w http.ResponseWriter, filename string) { @@ -96,3 +97,18 @@ func main() { log.Println("Error starting server:", err) } } + +func badurl(w http.ResponseWriter, badurl string) { + fmt.Fprintln(w, "<!DOCTYPE html>") + fmt.Fprintln(w, "<html>") + fmt.Fprintln(w, " <head>") + fmt.Fprintln(w, " <meta http-equiv=\"refresh\" content=\"3; url=https://go.wit.com/\">") + 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, " <br>") + fmt.Fprintln(w, " bad url", badurl, "<a href=\"https://git.wit.org/\">redirecting</a>") + fmt.Fprintln(w, " </body>") + fmt.Fprintln(w, "</html>") +} |
