Diverse anpassungen

This commit is contained in:
2026-02-03 23:25:37 +01:00
parent a3efbb43ae
commit d6e985998a
7 changed files with 332 additions and 94 deletions

View File

@@ -9,8 +9,18 @@ const app = express();
const PORT = 3333;
// Middleware
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
// UTF-8 explizit für URL-encoded Daten setzen (wichtig für Sonderzeichen wie ß, ü, ö, ä)
app.use(bodyParser.urlencoded({
extended: true,
type: 'application/x-www-form-urlencoded',
parameterLimit: 1000,
limit: '10mb'
}));
// Explizit UTF-8 für JSON
app.use(bodyParser.json({
type: 'application/json',
limit: '10mb'
}));
// Trust proxy für korrekte Client-IP-Erkennung (wichtig bei Proxies/Reverse Proxies)
app.set('trust proxy', true);
app.use(express.static('public'));