From 9a41fb90b9f53e85fd3d260d4d582f951411fa87 Mon Sep 17 00:00:00 2001 From: Jan-Lukas Else Date: Fri, 10 Jan 2020 11:14:35 +0100 Subject: [PATCH] Accept webmention without trailing slash when blogUrl has it --- webmention.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webmention.go b/webmention.go index f28c3d3..248cb83 100644 --- a/webmention.go +++ b/webmention.go @@ -85,7 +85,7 @@ func HandleWebmention(w http.ResponseWriter, r *http.Request) { return } // Check if target is blog - if !strings.HasPrefix(targetUrl.String(), BlogUrl) { + if !strings.HasPrefix(targetUrl.String(), strings.TrimSuffix(BlogUrl, "/")) { err = errors.New("wrong webmention target") w.WriteHeader(http.StatusBadRequest) _, _ = w.Write([]byte(err.Error()))