Merge pull request #384 from christophehenry/document-pushkey-error

Document Matrix pushkey error + set log level to warnings for Matrix errors
pull/392/head
Philipp C. Heckel 2022-08-21 12:37:31 -04:00 committed by GitHub
commit 29a248701f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -124,7 +124,7 @@ func newRequestFromMatrixJSON(r *http.Request, baseURL string, messageLimit int)
} }
pushKey := m.Notification.Devices[0].PushKey // We ignore other devices for now, see discussion in #316 pushKey := m.Notification.Devices[0].PushKey // We ignore other devices for now, see discussion in #316
if !strings.HasPrefix(pushKey, baseURL+"/") { if !strings.HasPrefix(pushKey, baseURL+"/") {
return nil, &errMatrix{pushKey: pushKey, err: errHTTPBadRequestMatrixPushkeyBaseURLMismatch} return nil, &errMatrix{pushKey: pushKey, err: wrapErrHTTP(errHTTPBadRequestMatrixPushkeyBaseURLMismatch, "; received pushKey: %s, configured base url: %s", pushKey, baseURL)}
} }
newRequest, err := http.NewRequest(http.MethodPost, pushKey, io.NopCloser(bytes.NewReader(body.PeekedBytes))) newRequest, err := http.NewRequest(http.MethodPost, pushKey, io.NopCloser(bytes.NewReader(body.PeekedBytes)))
if err != nil { if err != nil {