ostatus2
ostatus2 copied to clipboard
Base64 padding
The salmon spec defines the base64url
encoding as follows:
The encoding used to convert between the MIME type and the "data" string. In this specification, encoding MUST be the string "base64url", indicating the url safe base64 encoding as described in RFC 4648 [RFC4648], sans any trailing padding with equals (=) characters, and with the additional whitespace normalization rules specified in Section 5.1. All implementations MUST support this encoding. Appears exactly once.
Mastodon is sending base64 data with padding =
characters, and it shouldn't. You can set the padding
parameter to false
to solve this.
The decode_base64
hack is related to this: https://github.com/tootsuite/ostatus2/blob/master/lib/ostatus2/magic_key.rb#L12