Skip to content

Commit

Permalink
Bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
timetinytim committed Sep 11, 2024
1 parent 8318ebc commit 9adf6ae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions webpush-fcm-relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,21 +130,21 @@ func handler(writer http.ResponseWriter, request *http.Request) {
}

if len(components) > 4 {
message.Data["x"] = strings.Join(components[4:], "/")
message.Android.Data["x"] = strings.Join(components[4:], "/")
}

switch request.Header.Get("Content-Encoding") {
case "aesgcm":
if publicKey, err := encodedValue(request.Header, "Crypto-Key", "dh"); err == nil {
message.Data["k"] = publicKey
message.Android.Data["k"] = publicKey
} else {
http.Error(writer, "Error retrieving public key", http.StatusBadRequest)
requestLog.Error(fmt.Sprintf("Error retrieving public key: %s", err))
return
}

if salt, err := encodedValue(request.Header, "Encryption", "salt"); err == nil {
message.Data["s"] = salt
message.Android.Data["s"] = salt
} else {
http.Error(writer, "Error retrieving salt", http.StatusBadRequest)
requestLog.Error(fmt.Sprintf("Error retrieving salt: %s", err))
Expand Down

0 comments on commit 9adf6ae

Please sign in to comment.