Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serving ActivityPub objects #564

Closed
silverpill opened this issue Jun 3, 2022 · 7 comments · Fixed by #766
Closed

Serving ActivityPub objects #564

silverpill opened this issue Jun 3, 2022 · 7 comments · Fixed by #766
Labels
bug federation Issues related to federation
Milestone

Comments

@silverpill
Copy link

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.

@thebaer thebaer added bug federation Issues related to federation labels Sep 26, 2022
@thebaer thebaer added this to the 1.0 milestone Dec 23, 2022
thebaer added a commit that referenced this issue Sep 21, 2023
This returns ActivityStreams objects when the Accept header is
`application/ld+json; profile="https://www.w3.org/ns/activitystreams"`,
per the ActivityPub spec.

Fixes #564
@thebaer
Copy link
Member

thebaer commented Sep 21, 2023

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

@silverpill
Copy link
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?

lpar pushed a commit to postfreely/postfreely that referenced this issue Sep 23, 2023
This returns ActivityStreams objects when the Accept header is
`application/ld+json; profile="https://www.w3.org/ns/activitystreams"`,
per the ActivityPub spec.

Fixes writefreely#564
thebaer added a commit that referenced this issue Sep 26, 2023
This finishes the work started in #766, ensuring that requests to
canonical URLs of blogs and posts (not just at their API endpoints)
respond correctly to `application/ld+json;...` requests.

Fully addresses issue #564
@thebaer
Copy link
Member

thebaer commented Sep 26, 2023

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.

@silverpill
Copy link
Author

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

@thebaer
Copy link
Member

thebaer commented Oct 2, 2023

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

@silverpill
Copy link
Author

Everything working as expected. Thanks a lot

@thebaer
Copy link
Member

thebaer commented Oct 3, 2023

Great, thank you for verifying!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug federation Issues related to federation
Development

Successfully merging a pull request may close this issue.

2 participants