XRay icon indicating copy to clipboard operation
XRay copied to clipboard

Make this work with ActivityPub WordPress plugin

Open bekopharm opened this issue 4 years ago • 4 comments

The issue is described here: https://github.com/pfefferle/wordpress-activitypub/issues/78 and according to @pfefferle can probably only be solved in XRay: https://github.com/pfefferle/wordpress-activitypub/issues/78#issuecomment-570731802

bekopharm avatar Dec 20 '20 14:12 bekopharm

@aaronpk I think I thought of a workaround for this. I know it is an extra piece for your code, but how about this?

WordPress sites, even when delivering @pfefferle 's activitypub code, return two standard link headers.

rel="https://api.w.org/" - Which is a link to the WordPress Rest API endpoint rel="alternate"; type="application/json" - Which is a link to the JSON representation of the URL in the Rest API endpoint.

Could you, if you detect this, indicating a WordPress site, refetch the HTML and parse?

dshanske avatar Dec 20 '22 05:12 dshanske

Ok I've given this some thought and I have a different plan for how to handle it on the XRay side.

XRay is used for a lot of things, one of which being fetching a page to verify a webmention. Given that is it extremely unlikely to receive a webmention from an ActivityPub JSON URL, I'll add an option to XRay so that the caller can say "I'm trying to fetch this page for webmention verification" and that will disable adding the ActivityPub Accept header, since it will never expect to receive ActivityPub JSON when verifying a webmention. That seems to be the cleanest option that should avoid special casing sites.

aaronpk avatar Dec 23 '22 14:12 aaronpk

Done in 438430ffc20e02790f67c19b5d080401fc5bc697

Deploying to webmention.io now...

aaronpk avatar Dec 23 '22 15:12 aaronpk

Should be live now. Please test and let me know how it goes.

aaronpk avatar Dec 23 '22 15:12 aaronpk