Fix federation with Pleroma (take 2) #314
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Supersedes #313, but I wanted to make a separate PR so the solutions could be easily compared. See the original for more context.
Pleroma has a bug where
(created)is not an acceptable component to sign. This leads to a conundrum, becauseDateis a "forbidden" header name according to the fetch spec.At the same time, Mastodon requires that
Dateor(created)be part of the signature. So if you choose(created), federation with Pleroma breaks. If you chooseDate, you violate the fetch spec.Trying to set
(created)as an actual header throws. But settingDateand removing(created)actually works.I am running this code in Deno, not a Cloudflare worker. There I am able to set the
Dateheader just fine, and federation works perfectly with Mastodon, Pleroma, and Misskey. I tested all 3 this time.