Accept webmention without trailing slash when blogUrl has it

master
Jan-Lukas Else 2020-01-10 11:14:35 +01:00
parent 102f555cbc
commit 9a41fb90b9
1 changed files with 1 additions and 1 deletions

View File

@ -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()))