File tree Expand file tree Collapse file tree
Sources/VernissageServer/Services Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -245,6 +245,9 @@ final class ActivityPubSignatureService: ActivityPubSignatureServiceType {
245245 return data
246246 }
247247
248+ /// Examples of keyId:
249+ /// https://mastodon.example/users/mczachurski/main-key
250+ /// https://gotosocial.example/users/mczachurski#main-key
248251 private func getSignatureActor( activityPubRequest: ActivityPubRequestDto ) throws -> String {
249252 guard let signatureHeader = activityPubRequest. headers. keys. first ( where: { $0. lowercased ( ) == " signature " } ) ,
250253 let signatureHeaderValue = activityPubRequest. headers [ signatureHeader] else {
@@ -261,8 +264,11 @@ final class ActivityPubSignatureService: ActivityPubSignatureServiceType {
261264 guard let activityPubProfile = actorKey. split ( separator: " # " ) . first else {
262265 throw ActivityPubError . missingActivityPubProfileInKeyId ( String ( actorKey) )
263266 }
267+
268+ let activityPubProfileString = String ( activityPubProfile)
269+ let clearedActivityPubProfile = activityPubProfileString. deletingSuffix ( " /main-key " )
264270
265- return String ( activityPubProfile )
271+ return clearedActivityPubProfile
266272 }
267273
268274 private func getPayloadActor( activityPubRequest: ActivityPubRequestDto ) throws -> String ? {
You can’t perform that action at this time.
0 commit comments