~eliasnaur/giouiorg

437538b9a94e23d176309593f4aa3c415b57c331 — Elias Naur 7 months ago 65d74fc
cmd/giouiorg: return 404 for unknown vainity import paths

Signed-off-by: Elias Naur <mail@eliasnaur.com>
1 files changed, 4 insertions(+), 1 deletions(-)

M cmd/giouiorg/main.go
M cmd/giouiorg/main.go => cmd/giouiorg/main.go +4 -1
@@ 119,9 119,12 @@ func vanityHandler(fallback http.Handler) http.Handler {
			case strings.HasPrefix(p, "/x"):
				root = "gioui.org/x"
				repo = "https://git.sr.ht/~whereswaldon/gio-x"
			default:
			case p == "/":
				root = "gioui.org"
				repo = "https://git.sr.ht/~eliasnaur/gio"
			default:
				http.Error(w, "no such package", http.StatusNotFound)
				return
			}
			fmt.Fprintf(w, `<html><head>
<meta name="go-import" content="%[1]s git %[2]s">