Skip to content

Serving ActivityPub objects #564

Closed

Description

@silverpill

Describe the bug

According to ActivityPub specification, servers should respond with ActivityStreams object representation to requests having application/ld+json; profile="https://www.w3.org/ns/activitystreams" in Accept header, but apparently only application/activity+json is supported

Servers ... MUST present the ActivityStreams object representation in response to application/ld+json; profile="https://www.w3.org/ns/activitystreams", and SHOULD also present the ActivityStreams representation in response to application/activity+json as well.

if strings.Contains(accept, "application/activity+json") {

Steps to reproduce (if necessary)

curl -H 'Accept: application/ld+json; profile="https://www.w3.org/ns/activitystreams"' https://***/api/posts/***

The server returns the standard API response:

{
  "code": 200,
  "data": {
    ...
  }
}

Expected behavior

Server should return ActivityStreams object representation.

Activity

  1. added this to the 1.0 milestone on Dec 23, 2022
  2. added a commit that references this issue on Sep 21, 2023
    8f03da0
  3. thebaer commented on Sep 21, 2023

    @thebaer
    Member

    Thanks for reporting this! Fixed now, and will go into v0.14.

  4. silverpill commented on Sep 23, 2023

    @silverpill
    Author

    @thebaer I tried this:

    curl -H 'Accept: application/ld+json; profile="https://www.w3.org/ns/activitystreams"' https://blog.writefreely.org/version-0-14
    

    But it returns HTML, not JSON.

    The header value in #766 seems to be correct though. Perhaps the change wasn't included in 0.14?

  5. added a commit that references this issue on Sep 23, 2023
    51f8e66
  6. thebaer commented on Sep 26, 2023

    @thebaer
    Member

    Thanks for pointing that out! Looks like those previous changes only encompassed the API endpoints, and not the canonical / public URLs for blogs and posts. That's all fixed in #779.

  7. silverpill commented on Sep 27, 2023

    @silverpill
    Author

    Thank you for looking into this!
    Has this patch been applied to any live instance where I can test it?

  8. thebaer commented on Oct 2, 2023

    @thebaer
    Member

    Yes, it's live on Write.as now!

  9. silverpill commented on Oct 3, 2023

    @silverpill
    Author

    Everything working as expected. Thanks a lot

  10. thebaer commented on Oct 3, 2023

    @thebaer
    Member

    Great, thank you for verifying!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugfederationIssues related to federation

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions