mirror of
https://github.com/strapi/strapi.git
synced 2025-08-31 20:33:03 +00:00
handle cleanup of trailing /
This commit is contained in:
parent
ed364d951a
commit
e8231bbca2
@ -24,7 +24,13 @@ module.exports =
|
|||||||
const rateLimit = require('koa2-ratelimit').RateLimit;
|
const rateLimit = require('koa2-ratelimit').RateLimit;
|
||||||
|
|
||||||
const userEmail = toLower(ctx.request.body.email) || 'unknownEmail';
|
const userEmail = toLower(ctx.request.body.email) || 'unknownEmail';
|
||||||
const requestPath = toLower(ctx.request.path) || 'unknownPath';
|
let requestPath = toLower(ctx.request.path) || 'unknownPath';
|
||||||
|
|
||||||
|
if (requestPath.endsWith('/')) {
|
||||||
|
if (requestPath !== '/') {
|
||||||
|
requestPath = requestPath.slice(0, -1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const loadConfig = {
|
const loadConfig = {
|
||||||
interval: { min: 5 },
|
interval: { min: 5 },
|
||||||
|
@ -24,7 +24,13 @@ module.exports =
|
|||||||
const rateLimit = require('koa2-ratelimit').RateLimit;
|
const rateLimit = require('koa2-ratelimit').RateLimit;
|
||||||
|
|
||||||
const userIdentifier = toLower(ctx.request.body.email) || 'unknownIdentifier';
|
const userIdentifier = toLower(ctx.request.body.email) || 'unknownIdentifier';
|
||||||
const requestPath = toLower(ctx.request.path) || 'unknownPath';
|
let requestPath = toLower(ctx.request.path) || 'unknownPath';
|
||||||
|
|
||||||
|
if (requestPath.endsWith('/')) {
|
||||||
|
if (requestPath !== '/') {
|
||||||
|
requestPath = requestPath.slice(0, -1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const loadConfig = {
|
const loadConfig = {
|
||||||
interval: { min: 5 },
|
interval: { min: 5 },
|
||||||
|
Loading…
x
Reference in New Issue
Block a user