From 89bb46c49e434bcb97d0d799252d30bec71bb034 Mon Sep 17 00:00:00 2001 From: ari melody Date: Fri, 29 Aug 2025 16:29:28 +0100 Subject: [PATCH 1/2] day 1 patch --- main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.go b/main.go index 9133958..f3c9f66 100644 --- a/main.go +++ b/main.go @@ -33,6 +33,7 @@ import ( const DB_VERSION = 1 const DEFAULT_PORT int64 = 8080 +const HRT_DATE int64 = 1756478697 func main() { fmt.Printf("made with <3 by ari melody\n\n") @@ -605,6 +606,10 @@ func DefaultHeaders(next http.Handler) http.Handler { "X-Powered-By", PoweredByStrings[rand.Intn(len(PoweredByStrings))], ) + w.Header().Add( + "X-Days-Since-HRT", + fmt.Sprint(math.Round(time.Since(time.Unix(HRT_DATE, 0)).Hours() / 24)), + ) next.ServeHTTP(w, r) }) } From fd4335ced470306fe7263e45ca5505a857680042 Mon Sep 17 00:00:00 2001 From: ari melody Date: Sun, 7 Sep 2025 16:18:20 +0100 Subject: [PATCH 2/2] update security checks --- main.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index f3c9f66..eaed7c6 100644 --- a/main.go +++ b/main.go @@ -574,11 +574,10 @@ func CheckRequest(app *model.AppState, next http.Handler) http.Handler { return } - // same with .php and awkward double-slash requests. - // obviously these don't affect me, but these tend to be lazy intrusion - // attempts. if that's what you're about, i don't want you on my site. - if strings.HasPrefix(r.URL.Path, "//") || - strings.HasSuffix(r.URL.Path, ".php") || + // obviously .php requests these don't affect me, but these tend to be + // lazy wordpress intrusion attempts. if that's what you're about, i + // don't want you on my site. + if strings.HasSuffix(r.URL.Path, ".php") || strings.HasSuffix(r.URL.Path, ".php7") { http.NotFound(w, r) fmt.Fprintf(