ActivityPub: no user-agent sent with request Failure while creating client

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 Like

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 Like

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 Like

Thanks, it should be addressed once this gets merged:

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 Like

Sure, please do submit a PR, thanks!