Fix federation with GNU Social

This commit is contained in:
silverpill 2023-01-05 19:18:08 +00:00
parent 5c9aa0f148
commit 5b3aa2a24b
2 changed files with 11 additions and 0 deletions

View file

@ -20,3 +20,4 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Fixed
- Fixed post and profile page redirections.
- Fixed federation with GNU Social.

View file

@ -45,6 +45,16 @@ pub fn is_activitypub_request(headers: &HeaderMap) -> bool {
.and_then(|value| value.split(',').next())
.unwrap_or("");
return CONTENT_TYPES.contains(&content_type_str);
} else {
// No Accept header
let maybe_user_agent = headers.get("User-Agent")
.and_then(|value| value.to_str().ok());
if let Some(user_agent) = maybe_user_agent {
if user_agent.contains("THIS. IS. GNU social!!!!") {
// GNU Social doesn't add Accept header
return true;
};
};
};
false
}