mirror of
https://github.com/binwiederhier/ntfy.git
synced 2025-05-30 18:29:16 +02:00
Fix Matrix errors and tests
This commit is contained in:
parent
fbbfa2bbc1
commit
0d7aba9487
2 changed files with 5 additions and 26 deletions
server
|
@ -661,7 +661,7 @@ func (s *Server) handlePublish(w http.ResponseWriter, r *http.Request, v *visito
|
|||
func (s *Server) handlePublishMatrix(w http.ResponseWriter, r *http.Request, v *visitor) error {
|
||||
_, err := s.handlePublishWithoutResponse(r, v)
|
||||
if err != nil {
|
||||
return &errMatrix{pushKey: r.Header.Get(matrixPushKeyHeader), err: err}
|
||||
return err
|
||||
}
|
||||
return writeMatrixSuccess(w)
|
||||
}
|
||||
|
@ -1529,7 +1529,8 @@ func (s *Server) transformMatrixJSON(next handleFunc) handleFunc {
|
|||
}
|
||||
if err := next(w, newRequest, v); err != nil {
|
||||
logvr(v, r).Tag(tagMatrix).Err(err).Debug("Error handling Matrix request")
|
||||
return &errMatrix{pushKey: newRequest.Header.Get(matrixPushKeyHeader), err: err}
|
||||
// No normal error should cause pushKey rejection; don't set errMatrix.pushKey.
|
||||
return &errMatrix{err: err}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue