ソースを参照

Return only 404 on ActivityPub coll post request

Ref T493
pull/143/head
Matt Baer 4年前
コミット
35906118d0
2個のファイルの変更5行の追加1行の削除
  1. +4
    -0
      handle.go
  2. +1
    -1
      posts.go

+ 4
- 0
handle.go ファイルの表示

@@ -721,6 +721,10 @@ func (h *Handler) handleHTTPError(w http.ResponseWriter, r *http.Request, err er
return
} else if err.Status == http.StatusNotFound {
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))
return
} else if err.Status == http.StatusInternalServerError {


+ 1
- 1
posts.go ファイルの表示

@@ -1352,7 +1352,7 @@ Are you sure it was ever here?`,
fmt.Fprint(w, p.Content)
} else if strings.Contains(r.Header.Get("Accept"), "application/activity+json") {
if !postFound {
w.WriteHeader(http.StatusNotFound)
return ErrCollectionPageNotFound
}
p.extractData()
ap := p.ActivityObject()


読み込み中…
キャンセル
保存