ActivityPub: 요청에 user-agent가 전송되지 않음 - 클라이언트 생성 실패

Hey there,

I’m experiencing issues when trying to communicate with some Mastodon instances.

Seems that many admins have a config requirement to only interact with apps/servers that provide user-agent, which I can see the activitypub plugin is not providing.

Do you think you could add a user-agent like this to future versions requests?

‘Discourse-ActivityPub/x.y.z (+https://eg-discourse-domain.com)’ or similar?

This will fix both federation and the ability to link profiles to mastodon instances that have this requirement.

Thank you for your time reviewing this.

1개의 좋아요

This is a reasonable feature request. I gave it a shot in this PR: DEV: Add support for optional User-Agent header in outgoing requests by pmusaraj · Pull Request #268 · discourse/discourse-activity-pub · GitHub

@pmusaraj Federation is working as expected! Thank you!

Now I’m still seeing the same error when trying to vinculate an actor to my discourse profile, complaing that the user-agent is null (from the instance logs) and failing to create client.

The link for my profile is like:

https://example.com/u/ayr-ton/preferences/activity-pub

Can you share a screenshot of the instance log with the error?


An error occurred: no user-agent sent with request Failure to create client

Log that I’m seeing in the instance is the same: “no user-agent”

Those errors was also happening when users from the same instance was trying to follow the actors from discourse, but this is now fixed with the latest commit.

Also, the logs for this action are not showing in the plugin records, interesting.

1개의 좋아요

For testing, you can try linking your profile to ayr-ton.net or alquimidia.social.br and you will see the same errors. If the login appears the user-agent is being sent through the profile configuration as well.

1개의 좋아요

Thanks, it should be addressed once this gets merged:

https://github.com/discourse/discourse-activity-pub/pull/269

Amazing, the user-agent is fixed! :flexed_biceps:

Only error I’m seeing now (gotososocial instances, mastodon ones are working as expected in all scenarios):

invalid_request Bad Request: redirect_uri was not set in the token request form

Do you think this is a good first PR for me?

1개의 좋아요

Sure, please do submit a PR, thanks!

실수로 답글을 누르기 전에 게시물을 신고해버렸어요. 죄송합니다.

참고로, 2026년 크리스마스에 딱 맞춰서: