mirror of
https://github.com/fullstack-cash/bch-api.git
synced 2026-09-22 09:12:05 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e6dcaa2f24 | ||
|
|
698ac38251 | ||
|
|
7c66ce7f73 | ||
|
|
9e3dfd9848 | ||
|
|
10eb4da112 | ||
|
|
f4f5f02a2f | ||
|
|
bb69a6dee9 | ||
|
|
d67b3aa052 | ||
|
|
7e1c3d6a73 | ||
|
|
6165001790 |
Generated
+336
-524
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -28,7 +28,7 @@
|
|||||||
"node": ">=10.15.1"
|
"node": ">=10.15.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@psf/bch-js": "^3.5.5",
|
"@psf/bch-js": "^3.6.3",
|
||||||
"apidoc": "^0.23.0",
|
"apidoc": "^0.23.0",
|
||||||
"axios": "^0.19.0",
|
"axios": "^0.19.0",
|
||||||
"bitcore-lib-cash": "^8.20.3",
|
"bitcore-lib-cash": "^8.20.3",
|
||||||
|
|||||||
@@ -129,13 +129,18 @@ class RateLimits {
|
|||||||
origin &&
|
origin &&
|
||||||
(origin.toString().indexOf('wallet.fullstack.cash') > -1 ||
|
(origin.toString().indexOf('wallet.fullstack.cash') > -1 ||
|
||||||
origin.toString().indexOf('sandbox.fullstack.cash') > -1 ||
|
origin.toString().indexOf('sandbox.fullstack.cash') > -1 ||
|
||||||
origin.toString().indexOf('172.17.') > -1 ||
|
|
||||||
origin === 'slp-api')
|
origin === 'slp-api')
|
||||||
) {
|
) {
|
||||||
pointsToConsume = 1
|
pointsToConsume = 1
|
||||||
res.locals.pointsToConsume = pointsToConsume // Feedback for tests.
|
res.locals.pointsToConsume = pointsToConsume // Feedback for tests.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Apply paid-access rate limits based on key/IP
|
||||||
|
if (key.toString().indexOf('172.17.') > -1) {
|
||||||
|
pointsToConsume = 1
|
||||||
|
res.locals.pointsToConsume = pointsToConsume // Feedback for tests.
|
||||||
|
}
|
||||||
|
|
||||||
wlogger.info(
|
wlogger.info(
|
||||||
`User ${key} consuming ${pointsToConsume} point for resource ${resource}.`
|
`User ${key} consuming ${pointsToConsume} point for resource ${resource}.`
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user