[bugfix] Serve correct 'application/jrd+json' content type for webfinger requests (#1738)

* [bugfix] Return `application/jrd+json` from webfinger queries

* update finger req content-type
This commit is contained in:
tobi
2023-05-04 12:28:50 +02:00
committed by GitHub
parent 4a012acd52
commit 5027d0ced2
7 changed files with 128 additions and 161 deletions

View File

@@ -18,12 +18,7 @@
package webfinger_test
import (
"crypto/rand"
"crypto/rsa"
"time"
"github.com/stretchr/testify/suite"
"github.com/superseriousbusiness/gotosocial/internal/ap"
"github.com/superseriousbusiness/gotosocial/internal/api/wellknown/webfinger"
"github.com/superseriousbusiness/gotosocial/internal/db"
"github.com/superseriousbusiness/gotosocial/internal/email"
@@ -103,34 +98,3 @@ func (suite *WebfingerStandardTestSuite) TearDownTest() {
testrig.StandardStorageTeardown(suite.storage)
testrig.StopWorkers(&suite.state)
}
func accountDomainAccount() *gtsmodel.Account {
privateKey, err := rsa.GenerateKey(rand.Reader, 2048)
if err != nil {
panic(err)
}
publicKey := &privateKey.PublicKey
acct := &gtsmodel.Account{
ID: "01FG1K8EA7SYHEC7V6XKVNC4ZA",
CreatedAt: time.Now(),
UpdatedAt: time.Now(),
Username: "aaaaa",
Domain: "",
Privacy: gtsmodel.VisibilityDefault,
Language: "en",
URI: "http://gts.example.org/users/aaaaa",
URL: "http://gts.example.org/@aaaaa",
InboxURI: "http://gts.example.org/users/aaaaa/inbox",
OutboxURI: "http://gts.example.org/users/aaaaa/outbox",
FollowingURI: "http://gts.example.org/users/aaaaa/following",
FollowersURI: "http://gts.example.org/users/aaaaa/followers",
FeaturedCollectionURI: "http://gts.example.org/users/aaaaa/collections/featured",
ActorType: ap.ActorPerson,
PrivateKey: privateKey,
PublicKey: publicKey,
PublicKeyURI: "http://gts.example.org/users/aaaaa/main-key",
}
return acct
}