Skip to content

Commit 3e28de8

Browse files
wylitedCopilot
andauthored
Update src/plugins/metrics.ts
Co-authored-by: Copilot <[email protected]>
1 parent 6057846 commit 3e28de8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/plugins/metrics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import ipaddr from "ipaddr.js";
55
export default fp(async (fastify, opts) => {
66
fastify.addHook("onRequest", async (request, reply) => {
77
// Only check IP on the /metrics endpoint
8-
// Since we don't register this endpoint, we have to make this check.
8+
// The /metrics endpoint is registered by fastify-metrics, so we enforce IP restrictions here via the onRequest hook.
99
if (request.url.split("?")[0] === "/metrics") {
1010
const ip = request.ip;
1111

0 commit comments

Comments
 (0)