From 7e291a494768799111ca35e2da1a2bb6efb646dc Mon Sep 17 00:00:00 2001
From: Janne Mareike Koschinski <janne@kuschku.de>
Date: Fri, 28 Feb 2025 13:24:27 +0100
Subject: [PATCH] fix: request url for listener

---
 matrixbot.go | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/matrixbot.go b/matrixbot.go
index 69ea381..2604f8f 100644
--- a/matrixbot.go
+++ b/matrixbot.go
@@ -77,7 +77,8 @@ func (bot *MatrixBot) Serve(endpoint string) {
 	http.HandleFunc("/healthz", func(writer http.ResponseWriter, request *http.Request) {
 		_, _ = io.WriteString(writer, "OK\n")
 	})
-	http.HandleFunc(bot.pushUrl.RequestURI(), func(writer http.ResponseWriter, request *http.Request) {
+	log.Printf("listening for push notifications on %s\n", bot.pushUrl.Path)
+	http.HandleFunc(bot.pushUrl.Path, func(writer http.ResponseWriter, request *http.Request) {
 		log.Println("Received push notification")
 		notification, err := api.ParseNotification(request.Body)
 		if err != nil {
@@ -105,5 +106,6 @@ func (bot *MatrixBot) Serve(endpoint string) {
 		}
 		writer.WriteHeader(204)
 	})
+	fmt.Printf("listening for requests on %s\n", endpoint)
 	log.Fatal(http.ListenAndServe(endpoint, nil))
 }
-- 
GitLab