mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-17 08:34:54 -04:00
fix(frontend): fix motd e2e test
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
dd4e50103f
commit
dfbd45301c
6 changed files with 31 additions and 9 deletions
|
@ -62,7 +62,10 @@ export const respondToTestRequest = <T>(req: NextApiRequest, res: NextApiRespons
|
|||
res.status(405).send('Method not allowed')
|
||||
} else if (!isTestMode) {
|
||||
res.status(404).send('Route only available in test mode')
|
||||
} else if (!['127.0.0.1', '::1', '::ffff:127.0.0.1'].includes(req.socket.remoteAddress)) {
|
||||
} else if (
|
||||
req.socket.remoteAddress === undefined ||
|
||||
!['127.0.0.1', '::1', '::ffff:127.0.0.1'].includes(req.socket.remoteAddress)
|
||||
) {
|
||||
res.status(403).send(`Request must come from localhost but was ${req.socket.remoteAddress}`)
|
||||
} else {
|
||||
res.status(200).json(response())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue