Skip to content

Commit

Permalink
feat: v4.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
surmon-china committed May 9, 2024
1 parent 2307c14 commit 197b754
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to this project will be documented in this file.

### 4.7.0 (2024-05-10)

**Feature**

- Improve global throttler
- Improve global log interceptor format
- Upgrade dependencies

### 4.4.0 (2023-10-09)

**Breaking Change**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nodepress",
"version": "4.6.2",
"version": "4.7.0",
"description": "RESTful API service for Surmon.me blog",
"author": "Surmon",
"license": "MIT",
Expand Down
4 changes: 2 additions & 2 deletions src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ import { VoteModule } from '@app/modules/vote/vote.module'
limit: 600, // 600 limit
ignoreUserAgents: [/googlebot/gi, /bingbot/gi, /baidubot/gi],
skipIf: (context) => {
// Skip throttle for the front-end Server
// Skip throttle for the front-end server.
const request = context.switchToHttp().getRequest<Request>()
// Work only for front-end applications running on the same host machine
// Work only for front-end applications running on the same host machine.
return request.hostname === 'localhost' || ['127.0.0.1', '::1'].includes(request.ip)
}
}
Expand Down

0 comments on commit 197b754

Please sign in to comment.