Source code: https://pastebin.com/cCnnVA0d
(imports and declaration of some variables omitted).
When I execute that code I get 500 from Mastodon and 401 from Pleroma, I’m pretty sure lines 18-20 are at the fault here.
My server outputs this when sending GET requests to /users/admin (domain replaced with example.com):
{
"@context": "https://www.w3.org/ns/activitystreams",
"id": "https://example.com/users/admin",
"name": "admin",
"type": "Person",
"inbox": "https://example.com/users/admin/inbox",
"liked": "https://example.com/users/admin/liked",
"outbox": "https://example.com/users/admin/outbox",
"followers": "https://example.com/users/admin/followers",
"following": "https://example.com/users/admin/following",
"publicKey": {
"id": "https://example.com/users/admin#main-key",
"owner": "https://example.com/users/admin",
"publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq1PxyqkNEbeyRAIf7epP\n4IBPlcWIX6KV1E8IKzbWcNHAzw3f/e3ngUe9ny1R+72DZwnDU1BJ9DH2jKcLRN+G\nHGYaKLwfKthESe/gShdlLQGRMdoMTtI/QWP4RhK9opZ4Bs7WPUdvVPEzA6GaFFvs\nTeF0CTZOFBNZ7htIyYJe0UL3Anf4hsjzO+Y51BWfZrrQAXV6xlx/TWyHcaukkLmw\nQrBvyOiDmQjVtVVDvdVrFYjAt9+hjJBe645UKW0Wc03UydWFhs0evYFy9Rgp9kDr\nAAitRHCRp+PxXmw3bf/UThNTh4NCXGWRDJgYscnh17FZfCA/Le40kWvxTokXxpJ4\njQIDAQAB\n-----END PUBLIC KEY-----"
},
"preferredUsername": "admin"
}
What do I do?