From b7dd32da42c2bb958c6964ef3d02f936f8d31ccb Mon Sep 17 00:00:00 2001 From: Daenney Date: Sat, 6 May 2023 22:38:19 +0200 Subject: [bugfix] Return languages in api/v1/instance (#1741) It turns out that in Masto v2.3.0 the languages key was added to the V1 Instance and that it's effectively mandatory. Though in GtS we don't really have this concept yet, some apps will explode if the languages key is missing altogether. So at least return the empty array on V1 too in the hopes that it makes things work well enough. For history's sake, you can see the attributes that will get serialised in https://github.com/mastodon/mastodon/blob/f877aa9d70d0d600961989b8e97c0e0ce3ac1db6/app/serializers/rest/v1/instance_serializer.rb#L6-L9. Because the attribute does not have a conditional defined for it, there isn't a filter that optionally omits it, or a def languages to modify the behaviour the attribute is effectively always included and serialised. Fixes: #1662 --- internal/typeutils/internaltofrontend_test.go | 1 + 1 file changed, 1 insertion(+) (limited to 'internal/typeutils/internaltofrontend_test.go') diff --git a/internal/typeutils/internaltofrontend_test.go b/internal/typeutils/internaltofrontend_test.go index 993dc920b..1fb601260 100644 --- a/internal/typeutils/internaltofrontend_test.go +++ b/internal/typeutils/internaltofrontend_test.go @@ -497,6 +497,7 @@ func (suite *InternalToFrontendTestSuite) TestInstanceV1ToFrontend() { "short_description": "\u003cp\u003eThis is the GoToSocial testrig. It doesn't federate or anything.\u003c/p\u003e\u003cp\u003eWhen the testrig is shut down, all data on it will be deleted.\u003c/p\u003e\u003cp\u003eDon't use this in production!\u003c/p\u003e", "email": "admin@example.org", "version": "0.0.0-testrig", + "languages": [], "registrations": true, "approval_required": true, "invites_enabled": false, -- cgit v1.2.3