Skip to content

Commit 88eb062

Browse files
committed
policyeval/commands: urlencode SendPolicy state key
1 parent 43d99ac commit 88eb062

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

policyeval/commands.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"encoding/base64"
77
"encoding/json"
88
"fmt"
9+
"net/url"
910
"regexp"
1011
"slices"
1112
"strconv"
@@ -1101,5 +1102,6 @@ func (pe *PolicyEvaluator) SendPolicy(ctx context.Context, policyList id.RoomID,
11011102
stateKeyHash := sha256.Sum256(append([]byte(rawEntity), []byte(content.Recommendation)...))
11021103
stateKey = base64.StdEncoding.EncodeToString(stateKeyHash[:])
11031104
}
1105+
stateKey = url.PathEscape(stateKey)
11041106
return pe.Bot.SendStateEvent(ctx, policyList, entityType.EventType(), stateKey, content)
11051107
}

0 commit comments

Comments
 (0)