Skip to content

Commit e766ea7

Browse files
chore(nestjs) publish 5.3.5 release
1 parent 2f535c3 commit e766ea7

3 files changed

Lines changed: 5 additions & 10 deletions

File tree

bundle/common/cache/interceptors/cache.interceptor.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,10 @@ let CacheInterceptor = class CacheInterceptor {
4949
return this.reflector.get(cache_constants_1.CACHE_KEY_METADATA, context.getHandler());
5050
}
5151
const request = context.getArgByIndex(0);
52-
const excludePaths = [];
53-
if (this.httpServer.getRequestMethod(request) !== 'GET' ||
54-
excludePaths.includes(this.httpServer.getRequestUrl)) {
52+
if (this.httpServer.getRequestMethod(request) !== 'GET') {
5553
return undefined;
5654
}
57-
return this.httpServer.getRequestUrl(context.getArgByIndex(0));
55+
return this.httpServer.getRequestUrl(request);
5856
}
5957
};
6058
CacheInterceptor = __decorate([

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nestjs",
3-
"version": "5.3.4",
3+
"version": "5.3.5",
44
"description": "Modern, fast, powerful node.js web framework",
55
"scripts": {
66
"coverage": "nyc report --reporter=text-lcov | coveralls",

sample/20-cache/src/common/http-cache.interceptor.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,14 @@ import { CacheInterceptor, ExecutionContext, Injectable } from '@nestjs/common';
33
@Injectable()
44
class HttpCacheInterceptor extends CacheInterceptor {
55
trackBy(context: ExecutionContext): string | undefined {
6-
if (!this.isHttpApp) {
7-
return this.reflector.get(CACHE_KEY_METADATA, context.getHandler());
8-
}
9-
const request = context.getArgByIndex(0);
6+
const request = context.switchToHttp().getRequest();
107
const excludePaths = [];
118
if (
129
this.httpServer.getRequestMethod(request) !== 'GET' ||
1310
excludePaths.includes(this.httpServer.getRequestUrl)
1411
) {
1512
return undefined;
1613
}
17-
return this.httpServer.getRequestUrl(context.getArgByIndex(0));
14+
return this.httpServer.getRequestUrl(request);
1815
}
1916
}

0 commit comments

Comments
 (0)