mirror of
https://github.com/Akif9748/akf-forum.git
synced 2024-11-01 03:25:04 +03:00
Ratelimit fix + replace html content in messages
This commit is contained in:
parent
afc55b4dcb
commit
b1afa3e9a9
2 changed files with 5 additions and 5 deletions
|
@ -20,7 +20,7 @@ function renderMessage(message) {
|
||||||
<a href="/users/${message.author.id}"> ${message.author.name}</a>:
|
<a href="/users/${message.author.id}"> ${message.author.name}</a>:
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
<p>${message.content.replaceAll("\n", "<br>")}</p><br>
|
<p>${message.content.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll("\"", """).replaceAll("'", "'").replaceAll("\n", "<br>")}</p><br>
|
||||||
<div id="message-delete-${message.id}">
|
<div id="message-delete-${message.id}">
|
||||||
${/* if */!message.deleted ?
|
${/* if */!message.deleted ?
|
||||||
`
|
`
|
||||||
|
|
|
@ -5,12 +5,12 @@ const rateLimit = require('express-rate-limit')
|
||||||
|
|
||||||
const app = Router();
|
const app = Router();
|
||||||
|
|
||||||
app.get("/", (req, res) => res.reply("register", { user: null }));
|
app.get("/", rateLimit({
|
||||||
|
|
||||||
app.post("/", rateLimit({
|
|
||||||
windowMs: 24 * 60 * 60_000, max: 1, standardHeaders: true, legacyHeaders: false,
|
windowMs: 24 * 60 * 60_000, max: 1, standardHeaders: true, legacyHeaders: false,
|
||||||
handler: (_r, response, _n, options) => response.error(options.statusCode, "You are begin ratelimited")
|
handler: (_r, response, _n, options) => response.error(options.statusCode, "You are begin ratelimited")
|
||||||
}), async (req, res) => {
|
}), (req, res) => res.reply("register", { user: null }));
|
||||||
|
|
||||||
|
app.post("/", async (req, res) => {
|
||||||
req.session.userid = null;
|
req.session.userid = null;
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue