I wanted to make an action and provide an audit log reason that contains a Unicode character (✰ to be exact).
Since the header value cannot contain non-ISO-8859-1 characters (or, realistically, characters outside the US-ASCII charset), I provided a URL-encoded UTF-8 value to the X-Audit-Log-Reason header, expecting the API to decode it before storing. Instead, the value was stored as is.
FYI, this works fine on Discord.
Look at the audit log in the client to see the issue. You can also verify the value of the "reason" field for the audit log entry in DevTools to see that the reason was not decoded before storing.
FYI, the value of the reason before encoding in the above request is:
This seems to be resolved in at least one definition of resolved. As in, the canary UI shows it correctly, but the reason field in API responses remains URL-encoded. I'm not sure whether that's the expected behaviour, it doesn't seem ideal from the API user's perspective and it differs from how Discord does it.
image
4 comments
Comment by Rex
Comment by Rex
Comment by Jackuczys
reasonfield in API responses remains URL-encoded. I'm not sure whether that's the expected behaviour, it doesn't seem ideal from the API user's perspective and it differs from how Discord does it. image608897919-3a891110-eeee-4f9e-82ee-518e5279eb5c.png
2545×946 | 457 kB Link to 608897919-3a891110-eeee-4f9e-82ee-518e5279eb5c.png
Comment by Jackuczys