Compare commits

...

3 Commits

Author SHA1 Message Date
Jason Swank
c4d4dcd1bf wip 2026-05-17 22:59:54 -04:00
Jason Swank
0e871220de require host header 2026-05-17 22:18:23 -04:00
Jason Swank
43322b40d5 wip 2026-05-17 21:58:45 -04:00
2 changed files with 11 additions and 0 deletions

3
env.sample Normal file
View File

@@ -0,0 +1,3 @@
PROJECT_ID=
REGION=us-east4
DOMAIN=proto-hype.net

View File

@@ -17,6 +17,14 @@ func main() {
rand.Seed(time.Now().UnixNano())
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
log.Printf("Received request from %s, Host: %s", r.RemoteAddr, r.Host)
// error handling for common probes
if r.URL.Path != "/" {
http.NotFound(w, r)
return
}
// Default to 2 words, can be overridden by query param "words"
words := 2
if wParam := r.URL.Query().Get("words"); wParam != "" {