Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cortec/polka

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cortec/polka - npm Package Compare versions

Comparing version 1.6.0 to 1.6.1

11

dist/index.js

@@ -155,6 +155,9 @@ "use strict";

if (rateLimit && controller.rateLimit) {
const rateLimitRes = await rateLimit.consume(controller.rateLimit.count.call(ctx, req, reqCtx));
if (!rateLimitRes) {
throw new ResponseError_1.default(HttpStatusCodes_1.default.TOO_MANY_REQUESTS, 'Too many requests', {});
}
await rateLimit
.consume(controller.rateLimit.count.call(ctx, req, reqCtx))
.catch((err) => {
throw new ResponseError_1.default(HttpStatusCodes_1.default.TOO_MANY_REQUESTS, 'Too many requests', {
retryAfter: err.msBeforeNext / 1000 + 's',
});
});
}

@@ -161,0 +164,0 @@ if (controller.schema) {

@@ -8,4 +8,4 @@ /// <reference types="node" />

constructor(statusCode: HttpStatusCode, message: string, details: T);
get name(): "Forbidden" | "BadRequest" | "NotFound" | "ServerError" | "ClientError" | "Error";
get name(): "Forbidden" | "BadRequest" | "NotFound" | "RateLimit" | "ServerError" | "ClientError" | "Error";
send(res: http.ServerResponse): any;
}

@@ -22,2 +22,4 @@ "use strict";

return 'NotFound';
case HttpStatusCodes_1.default.TOO_MANY_REQUESTS:
return 'RateLimit';
}

@@ -24,0 +26,0 @@ if (this.statusCode >= 500) {

{
"name": "@cortec/polka",
"version": "1.6.0",
"version": "1.6.1",
"description": "<description>",

@@ -48,3 +48,3 @@ "main": "dist/index.js",

},
"gitHead": "4216f2327771933ed5271a0304fb888293bee225"
"gitHead": "d834fa3c493119b1a0c6f175d5322c54ff370a99"
}
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