Skip to content

Commit

Permalink
Merge pull request #196 from sickpig/add-rate-limit-to-address-view
Browse files Browse the repository at this point in the history
  • Loading branch information
sickpig committed Aug 23, 2023
2 parents 8b5329a + 659d91a commit 96468ba
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -37,6 +37,7 @@
"dotenv": "^8.2.0",
"electrum-client": "github:janoside/electrum-client",
"express": "^4.17.1",
"express-rate-limit": "^6.6.0",
"express-session": "^1.17.1",

This comment has been minimized.

Copy link
@Nelyydavid4

Nelyydavid4 Sep 19, 2023

bitcoincash:qpcxzctc3hwx3nwh4ranqzx7f3fx9rp0csed8hn5tp

This comment has been minimized.

Copy link
@jimmy591

jimmy591 Oct 30, 2023

ou tu a trouver cette adresse merci

"jstransformer-markdown-it": "^2.1.0",
"lru-cache": "^5.1.1",
Expand Down
11 changes: 10 additions & 1 deletion routes/baseActionsRouter.js
Expand Up @@ -2,6 +2,7 @@ var debug = require("debug");
var debugLog = debug("bchexp:router");

var express = require('express');
const rateLimit = require('express-rate-limit');
var csurf = require('csurf');
var router = express.Router();
var util = require('util');
Expand Down Expand Up @@ -979,7 +980,15 @@ router.get("/tx/:transactionId", function(req, res, next) {
});
});

router.get("/address/:address", async (req, res) => {
const addressLimiter = rateLimit({
windowMs: 1 * 60 * 1000,
max: 1,
standardHeaders: true,
legacyHeaders: false,
});


router.get("/address/:address", addressLimiter, async (req, res) => {
var limit = config.site.addressTxPageSize;
var offset = 0;
var sort = "desc";
Expand Down

1 comment on commit 96468ba

@Nelyydavid4
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.