Fix HTML error pages being returned when JSON is expected (#12713)
Fix HTML error pages being returned when JSON is expected (#12713)

Fix #12509
See also #12214
Kirishima21/mastodon,lynlynlynx/mastodon,Kirishima21/mastodon,cobodo/mastodon,ykzts/mastodon,ikuradon/mastodon,dunn/mastodon,maa123/mastodon,tri-star/mastodon,lynlynlynx/mastodon,gol-cha/mastodon,kazh98/social.arnip.org,yukimochi/mastodon,Nyoho/mastodon,musashino205/mastodon,musashino205/mastodon,yukimochi/mastodon,h3zjp/mastodon,pinfort/mastodon,koba-lab/mastodon,tootsuite/mastodon,Ryanaka/mastodon,lynlynlynx/mastodon,glitch-soc/mastodon,tri-star/mastodon,h3zjp/mastodon,primenumber/mastodon,dunn/mastodon,primenumber/mastodon,yi0713/mastodon,maa123/mastodon,kirakiratter/mastodon,danhunsaker/mastodon,ikuradon/mastodon,im-in-space/mastodon,imas/mastodon,lynlynlynx/mastodon,rainyday/mastodon,ikuradon/mastodon,abcang/mastodon,MitarashiDango/mastodon,MitarashiDango/mastodon,kazh98/social.arnip.org,dunn/mastodon,danhunsaker/mastodon,rainyday/mastodon,ykzts/mastodon,yukimochi/mastodon,theoria24/mastodon,kirakiratter/mastodon,tootsuite/mastodon,im-in-space/mastodon,Ryanaka/mastodon,glitch-soc/mastodon,gol-cha/mastodon,glitch-soc/mastodon,cobodo/mastodon,pinfort/mastodon,cobodo/mastodon,MitarashiDango/mastodon,dunn/mastodon,masto-donte-com-br/mastodon,h3zjp/mastodon,Kirishima21/mastodon,theoria24/mastodon,primenumber/mastodon,imas/mastodon,abcang/mastodon,tootcafe/mastodon,abcang/mastodon,imas/mastodon,kirakiratter/mastodon,tootsuite/mastodon,Ryanaka/mastodon,h3zjp/mastodon,theoria24/mastodon,maa123/mastodon,tootcafe/mastodon,tri-star/mastodon,koba-lab/mastodon,kirakiratter/mastodon,koba-lab/mastodon,pinfort/mastodon,pinfort/mastodon,yi0713/mastodon,danhunsaker/mastodon,ykzts/mastodon,tootsuite/mastodon,kazh98/social.arnip.org,masto-donte-com-br/mastodon,MitarashiDango/mastodon,tri-star/mastodon,im-in-space/mastodon,tootcafe/mastodon,tootcafe/mastodon,rainyday/mastodon,masto-donte-com-br/mastodon,lindwurm/mastodon,Nyoho/mastodon,musashino205/mastodon,koba-lab/mastodon,gol-cha/mastodon,imas/mastodon,maa123/mastodon,abcang/mastodon,primenumber/mastodon,Ryanaka/mastodon,yi0713/mastodon,cobodo/mastodon,kazh98/social.arnip.org,gol-cha/mastodon,Nyoho/mastodon,rainyday/mastodon,lindwurm/mastodon,lindwurm/mastodon,yi0713/mastodon,glitch-soc/mastodon,Kirishima21/mastodon,theoria24/mastodon,danhunsaker/mastodon,masto-donte-com-br/mastodon,ykzts/mastodon,ikuradon/mastodon,lindwurm/mastodon,im-in-space/mastodon,Nyoho/mastodon,musashino205/mastodon,yukimochi/mastodon