Skip to content

Commit 6c28e64

Browse files
committed
remove reate limitter as this needs to be done at nginx level for specific cases
For eg: revent url scanning, when too many distict paths scanned by single ip, should ban ip?(without banning legitimate users).
1 parent 02d58b4 commit 6c28e64

File tree

3 files changed

+0
-46
lines changed

3 files changed

+0
-46
lines changed

package-lock.json

Lines changed: 0 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
"dependencies": {
6565
"@aicore/libcommonutils": "1.0.20",
6666
"@fastify/compress": "^8.0.1",
67-
"@fastify/rate-limit": "^10.2.2",
6867
"@fastify/static": "8.1.0",
6968
"fastify": "5.2.1",
7069
"node-fetch": "3.3.2"

src/server.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {HTTP_STATUS_CODES} from "@aicore/libcommonutils";
99
import {getConfigs} from "./utils/configs.js";
1010
import {getHelloSchema, hello, getHelloPostSchema, helloPost} from "./api/hello.js";
1111
import {fastifyStatic} from "@fastify/static";
12-
import rateLimit from '@fastify/rate-limit';
1312
import compression from '@fastify/compress';
1413

1514
import path from 'path';
@@ -42,18 +41,6 @@ server.register(compression, {
4241
threshold: 1024 // Only compress responses larger than 1KB
4342
});
4443

45-
server.register(rateLimit, {
46-
max: 100,
47-
timeWindow: '1 minute',
48-
errorResponseBuilder: function (request, context) {
49-
return {
50-
code: 429,
51-
error: 'Too Many Requests',
52-
message: `Rate limit exceeded, retry in ${context.after}`
53-
};
54-
}
55-
});
56-
5744
// Global error handler with correlation ID
5845
server.setErrorHandler((error, request, reply) => {
5946
const errorLog = {

0 commit comments

Comments
 (0)