Skip to content

Commit

Permalink
WebFinger: Add alternate mime type to results
Browse files Browse the repository at this point in the history
  • Loading branch information
benpate committed Aug 29, 2024
1 parent c5193ba commit 0c83e49
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions model/mimeType.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const MimeTypeJSON = "application/json"

const MimeTypeJSONLD = "application/ld+json"

const MimeTypeJSONLDWithProfile = `application/ld+json; profile="https://www.w3.org/ns/activitystreams"`

const MimeTypeJSONFeed = "application/feed+json"

const MimeTypeJSONResourceDescriptor = "application/jrd+json"
Expand Down
1 change: 1 addition & 0 deletions service/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,7 @@ func (service *User) LoadWebFinger(username string) (digit.Resource, error) {
result := digit.NewResource("acct:"+username+"@"+domain.NameOnly(service.host)).
Alias(user.ActivityPubURL()).
Link(digit.RelationTypeSelf, model.MimeTypeActivityPub, user.ActivityPubURL()).
Link(digit.RelationTypeSelf, model.MimeTypeJSONLDWithProfile, user.ActivityPubURL()).
Link(digit.RelationTypeHub, model.MimeTypeJSONFeed, user.JSONFeedURL()).
Link(digit.RelationTypeProfile, model.MimeTypeHTML, user.ActivityPubURL()).
Link(digit.RelationTypeAvatar, model.MimeTypeImage, user.ActivityPubIconURL()).
Expand Down

0 comments on commit 0c83e49

Please sign in to comment.