Sure, you can do that. I think I have the answer though. Both sh.itjust.works and feddit.nu have the issue where they return html when they should return json if the Accept header isn’t a very specific string. There’s a patch for the nginx config to solve it available but it seems they’ve not applied it yet.
You can test any instance for this by doing the following.
Find a local user on the instance and get their page (https://instance.tld/u/username).
Find a linux (or any OS that has it) with curl installed and type the following:
curl -X GET -H 'Accept: application/activity+json,application/json' https://userlink
If the result is html they have not patched, if it is json, they have patched.
curl -X GET -H 'Accept: application/activity+json' https://userlink
Will return json all the time on all instances, and I’ve patched my kbin to use this Accept header until all are fixed.
Oh that makes sense, thank you for going above and beyond!
Is it worth contacting Ernest about implementing your fix for the main Kbin code for better compatibility or are most Lemmy instances likely to fix the issue so soon it’s not worth bothering him?
I have pull requests for other changes to do with federation. I have a branch with this change in, but I’ve so far not made it a PR because I didn’t consider we should need to change this, and also because there was a patch on Lemmy’s side already available. Lemmy.ml, lemmy.world, beehaw.org are all working correctly now for example.
But if this is going to go on for long, I may well turn it into a PR too and see what people think.
Sure, you can do that. I think I have the answer though. Both sh.itjust.works and feddit.nu have the issue where they return html when they should return json if the Accept header isn’t a very specific string. There’s a patch for the nginx config to solve it available but it seems they’ve not applied it yet.
You can test any instance for this by doing the following.
Find a local user on the instance and get their page (https://instance.tld/u/username).
Find a linux (or any OS that has it) with curl installed and type the following:
curl -X GET -H 'Accept: application/activity+json,application/json' https://userlink
If the result is html they have not patched, if it is json, they have patched.
curl -X GET -H 'Accept: application/activity+json' https://userlink
Will return json all the time on all instances, and I’ve patched my kbin to use this Accept header until all are fixed.
Oh that makes sense, thank you for going above and beyond!
Is it worth contacting Ernest about implementing your fix for the main Kbin code for better compatibility or are most Lemmy instances likely to fix the issue so soon it’s not worth bothering him?
I have pull requests for other changes to do with federation. I have a branch with this change in, but I’ve so far not made it a PR because I didn’t consider we should need to change this, and also because there was a patch on Lemmy’s side already available. Lemmy.ml, lemmy.world, beehaw.org are all working correctly now for example.
But if this is going to go on for long, I may well turn it into a PR too and see what people think.