Skip to content

Commit

Permalink
fix: do not show the internal awkhash event attr
Browse files Browse the repository at this point in the history
  • Loading branch information
akurilov committed Mar 5, 2024
1 parent fdf3a50 commit 9c87467
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion service/messages/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ func (f Format) convertExtraAttrs(evt *pb.CloudEvent, mode FormatMode, trunc boo
case "title":
case "awakarimatchfound": // internal
case "awakariuserid": // do not expose
case "awkhash": // internal, useless
case "feedcategories":
case "feeddescription":
case "feedimagetitle":
Expand All @@ -160,7 +161,7 @@ func (f Format) convertExtraAttrs(evt *pb.CloudEvent, mode FormatMode, trunc boo
case *pb.CloudEventAttributeValue_CeInteger:
txt += fmt.Sprintf("%s: %d\n", attrName, vt.CeInteger)
case *pb.CloudEventAttributeValue_CeString:
if vt.CeString != evt.Source { // "subject" sometimes has the same value as the source
if vt.CeString != evt.Source { // "object"/"objecturl" might the same value as the source
v := f.HtmlPolicy.Sanitize(vt.CeString)
if trunc {
v = truncateStringUtf8(v, fmtLenMaxAttrVal)
Expand Down

0 comments on commit 9c87467

Please sign in to comment.