mirror of https://github.com/jlelse/GoBlog
Reject webmentions where target equals source
This commit is contained in:
parent
098cfbaa2e
commit
4015bdba74
|
@ -62,6 +62,11 @@ func (a *goBlog) handleWebmention(w http.ResponseWriter, r *http.Request) {
|
||||||
a.serveError(w, r, "target not allowed", http.StatusBadRequest)
|
a.serveError(w, r, "target not allowed", http.StatusBadRequest)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if m.Target == m.Source {
|
||||||
|
a.debug("Webmention target and source are the same:", m.Target)
|
||||||
|
a.serveError(w, r, "target and source are the same", http.StatusBadRequest)
|
||||||
|
return
|
||||||
|
}
|
||||||
if err = a.queueMention(m); err != nil {
|
if err = a.queueMention(m); err != nil {
|
||||||
a.debug("Failed to queue webmention", err.Error())
|
a.debug("Failed to queue webmention", err.Error())
|
||||||
a.serveError(w, r, err.Error(), http.StatusInternalServerError)
|
a.serveError(w, r, err.Error(), http.StatusInternalServerError)
|
||||||
|
|
Loading…
Reference in New Issue