| 68 | 72 | const ipDetails = forwardedIp |
| 69 | 73 | ? `${clientIp} (forwarded from ${forwardedIp})` |
| 70 | 74 | : clientIp; |
| 71 | | - console.warn( |
| 75 | + |
| 72 | | - color.red( |
| 76 | + if (!noLogPaths.includes(req.path)) { |
| 73 | | - `Blocked connection from ${clientIp}; User Agent: ${userAgent}\n\tTo allow this connection, add its IP address to the whitelist or disable whitelist mode by editing config.yaml in the root directory of your SillyTavern installation.\n`, |
| 77 | + console.warn( |
| 74 | | - ), |
| 78 | + color.red( |
| 75 | | - ); |
| 79 | + `Blocked connection from ${clientIp}; User Agent: ${userAgent}\n\tTo allow this connection, add its IP address to the whitelist or disable whitelist mode by editing config.yaml in the root directory of your SillyTavern installation.\n`, |
| 80 | + ), |
| 81 | + ); |
| 82 | + } |
| 83 | + |
| 76 | 84 | return res.status(403).send(forbiddenWebpage({ ipDetails })); |
| 77 | 85 | } |
| 78 | 86 | next(); |