Accept webmention without trailing slash when blogUrl has it
parent
102f555cbc
commit
9a41fb90b9
|
@ -85,7 +85,7 @@ func HandleWebmention(w http.ResponseWriter, r *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// Check if target is blog
|
// 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")
|
err = errors.New("wrong webmention target")
|
||||||
w.WriteHeader(http.StatusBadRequest)
|
w.WriteHeader(http.StatusBadRequest)
|
||||||
_, _ = w.Write([]byte(err.Error()))
|
_, _ = w.Write([]byte(err.Error()))
|
||||||
|
|
Loading…
Reference in New Issue