fix: redirect to homepage when coming from fediverse, fix #478

This commit is contained in:
lesion 2025-01-17 16:40:33 +01:00
parent 5abb3cd1a1
commit 5f0728eb3e
No known key found for this signature in database
GPG key ID: 352918250B012177

View file

@ -10,8 +10,11 @@ const get = require('lodash/get')
module.exports = {
get (req, res) {
if (req.accepts(['html','json']) === 'html') {
log.debug('[FEDI] Get actor but prefer text/html, redirect to homepage')
return res.redirect(301, '/')
}
log.debug('[FEDI] Get actor')
// if (req.accepts('html')) { return res.redirect(301, '/') }
const settings = settingsController.settings
const name = req.params.name
if (!name) { return res.status(400).send('Bad request.') }