mirror of
https://github.com/writeas/writefreely
synced 2025-02-02 09:16:51 +01:00
Return only 404 on ActivityPub coll post request
Ref T493
This commit is contained in:
parent
f541f72224
commit
35906118d0
@ -721,6 +721,10 @@ func (h *Handler) handleHTTPError(w http.ResponseWriter, r *http.Request, err er
|
|||||||
return
|
return
|
||||||
} else if err.Status == http.StatusNotFound {
|
} else if err.Status == http.StatusNotFound {
|
||||||
w.WriteHeader(err.Status)
|
w.WriteHeader(err.Status)
|
||||||
|
if strings.Contains(r.Header.Get("Accept"), "application/activity+json") {
|
||||||
|
// This is a fediverse request; simply return the header
|
||||||
|
return
|
||||||
|
}
|
||||||
h.errors.NotFound.ExecuteTemplate(w, "base", pageForReq(h.app.App(), r))
|
h.errors.NotFound.ExecuteTemplate(w, "base", pageForReq(h.app.App(), r))
|
||||||
return
|
return
|
||||||
} else if err.Status == http.StatusInternalServerError {
|
} else if err.Status == http.StatusInternalServerError {
|
||||||
|
2
posts.go
2
posts.go
@ -1352,7 +1352,7 @@ Are you sure it was ever here?`,
|
|||||||
fmt.Fprint(w, p.Content)
|
fmt.Fprint(w, p.Content)
|
||||||
} else if strings.Contains(r.Header.Get("Accept"), "application/activity+json") {
|
} else if strings.Contains(r.Header.Get("Accept"), "application/activity+json") {
|
||||||
if !postFound {
|
if !postFound {
|
||||||
w.WriteHeader(http.StatusNotFound)
|
return ErrCollectionPageNotFound
|
||||||
}
|
}
|
||||||
p.extractData()
|
p.extractData()
|
||||||
ap := p.ActivityObject()
|
ap := p.ActivityObject()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user