Skip to content
This repository has been archived by the owner on Nov 23, 2022. It is now read-only.

v3.1.0 #85

Merged
merged 2 commits into from
Dec 1, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
upgrade to v3.1.0
  • Loading branch information
onur-ozkan committed Dec 1, 2021
commit 76238590aaedb8ddaa674a58dc34487baa8aa60b
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
- [omitResponseHeaders](https://github.com/ozkanonur/nestjs-rate-limiter#-omitResponseHeaders)
- [errorMessage](https://github.com/ozkanonur/nestjs-rate-limiter#-errorMessage)
- [customResponseSchema](https://github.com/ozkanonur/nestjs-rate-limiter#-customResponseSchema)
- [Override Functions](https://github.com/ozkanonur/nestjs-rate-limiter#override-functions)
- [Benchmarks](https://github.com/ozkanonur/nestjs-rate-limiter#benchmarks)
- [TODO List](https://github.com/ozkanonur/nestjs-rate-limiter#todo)

Expand Down Expand Up @@ -465,6 +466,22 @@ GraphQLModule.forRoot({
<br>

customResponseSchema option allows to provide customizable response schemas

# Override Functions

#### It's possible to override <code> getIpFromRequest </code> function by extending <code> RateLimiterGuard </code> class.

```ts
import { RateLimiterGuard } from 'nestjs-rate-limiter'
import type { Request } from 'express'

class ExampleRateLimiterGuard extends RateLimiterGuard {
protected getIpFromRequest(request: Request): string {
return request.get('x-forwarded-for');
}
}
```

# Benchmarks

1000 concurrent clients with maximum 2000 requests per sec during 30 seconds.
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nestjs-rate-limiter",
"version": "3.0.0",
"version": "3.1.0",
"description": "Highly configurable and extensible rate limiter library",
"repository": {
"type": "git",
Expand Down