New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@musicode/egg-rate-limiter

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@musicode/egg-rate-limiter - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

app/.DS_Store

16

app/middleware/rate_limiter.js

@@ -27,4 +27,3 @@

* }
* options.error - 超过调用上限时的错误信息
* options.tidy - limit the records count, no greater than max [false]
* options.onError - 超过调用上限时的回调
*/

@@ -35,3 +34,3 @@ module.exports = (options, app) => {

routers,
error,
onError,
} = options

@@ -97,5 +96,10 @@

// 429 表示过多的请求
ctx.status = 429
ctx.body = error || `Rate limit exceeded, retry in ${ms(delta, { long: true })}.`
if (onError) {
onError(ctx)
}
else {
// 429 表示过多的请求
ctx.status = 429
ctx.body = `Rate limit exceeded, retry in ${ms(delta, { long: true })}.`
}

@@ -102,0 +106,0 @@ }

{
"name": "@musicode/egg-rate-limiter",
"version": "0.0.2",
"version": "0.0.3",
"description": "",

@@ -5,0 +5,0 @@ "eggPlugin": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc