Files
ports/net/xapsd/files/patch-internal_socket.go
T
Henry 2d98b88458 net/xapsd: Update g20240326 => g20241228
- fixes CVE-2024-45338 and CVE-2024-51744
- requires at least go 1.23, so use latest stable
- adds sub folder support

Commit log:
https://github.com/freswa/dovecot-xaps-daemon/compare/1e589be...8cf4e49

PR:	285485
2025-03-20 17:42:33 +03:00

45 lines
1.4 KiB
Go

--- internal/socket.go.orig 2024-03-26 13:15:17 UTC
+++ internal/socket.go
@@ -2,12 +2,13 @@ package internal
import (
"encoding/json"
+ "net/http"
+ "strings"
+
"github.com/freswa/dovecot-xaps-daemon/internal/config"
"github.com/freswa/dovecot-xaps-daemon/internal/database"
"github.com/julienschmidt/httprouter"
log "github.com/sirupsen/logrus"
- "net/http"
- "strings"
)
type httpHandler struct {
@@ -147,11 +148,11 @@ func (httpHandler *httpHandler) handleNotify(writer ht
}
// we don't know how to handle other mailboxes other than INBOX, so ignore them
- if notify.Mailbox != "INBOX" {
- log.Debugln("Ignoring non INBOX event for:", notify.Mailbox)
- writer.WriteHeader(http.StatusOK)
- return
- }
+ //if notify.Mailbox != "INBOX" {
+ // log.Debugln("Ignoring non INBOX event for:", notify.Mailbox)
+ // writer.WriteHeader(http.StatusOK)
+ // return
+ //}
// Find all the devices registered for this mailbox event
registrations, err := httpHandler.db.FindRegistrations(notify.Username, notify.Mailbox)
@@ -179,7 +180,7 @@ func (httpHandler *httpHandler) handleNotify(writer ht
// Send a notification to all registered devices. We ignore failures
// because there is not a lot we can do.
for _, registration := range registrations {
- httpHandler.apns.SendNotification(registration, !isMessageNew)
+ httpHandler.apns.SendNotification(registration, !isMessageNew, notify.Mailbox)
}
writer.WriteHeader(http.StatusOK)