Allow application/json

This commit is contained in:
Bryan Ashby 2023-04-20 19:30:08 -06:00
parent 32bb0c4937
commit db3387d6c5
No known key found for this signature in database
GPG Key ID: C2C1B501E4EFD994
1 changed files with 5 additions and 1 deletions

View File

@ -57,7 +57,11 @@ function queryWebFinger(query, cb) {
} }
const contentType = res.headers['content-type'] || ''; const contentType = res.headers['content-type'] || '';
if (!contentType.startsWith('application/jrd+json')) { if (
!['application/jrd+json', 'application/json'].some(ct =>
contentType.startsWith(ct)
)
) {
return cb( return cb(
Errors.Invalid( Errors.Invalid(
`Invalid Content-Type for WebFinger URL ${webFingerUrl}: ${contentType}` `Invalid Content-Type for WebFinger URL ${webFingerUrl}: ${contentType}`