Skip to content

Commit

Permalink
chore(nestjs) publish 5.3.5 release
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed Sep 5, 2018
1 parent 2f535c3 commit e766ea7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
6 changes: 2 additions & 4 deletions bundle/common/cache/interceptors/cache.interceptor.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,10 @@ let CacheInterceptor = class CacheInterceptor {
return this.reflector.get(cache_constants_1.CACHE_KEY_METADATA, context.getHandler());
}
const request = context.getArgByIndex(0);
const excludePaths = [];
if (this.httpServer.getRequestMethod(request) !== 'GET' ||
excludePaths.includes(this.httpServer.getRequestUrl)) {
if (this.httpServer.getRequestMethod(request) !== 'GET') {
return undefined;
}
return this.httpServer.getRequestUrl(context.getArgByIndex(0));
return this.httpServer.getRequestUrl(request);
}
};
CacheInterceptor = __decorate([
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": "nestjs",
"version": "5.3.4",
"version": "5.3.5",
"description": "Modern, fast, powerful node.js web framework",
"scripts": {
"coverage": "nyc report --reporter=text-lcov | coveralls",
Expand Down
7 changes: 2 additions & 5 deletions sample/20-cache/src/common/http-cache.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@ import { CacheInterceptor, ExecutionContext, Injectable } from '@nestjs/common';
@Injectable()
class HttpCacheInterceptor extends CacheInterceptor {
trackBy(context: ExecutionContext): string | undefined {
if (!this.isHttpApp) {
return this.reflector.get(CACHE_KEY_METADATA, context.getHandler());
}
const request = context.getArgByIndex(0);
const request = context.switchToHttp().getRequest();
const excludePaths = [];
if (
this.httpServer.getRequestMethod(request) !== 'GET' ||
excludePaths.includes(this.httpServer.getRequestUrl)
) {
return undefined;
}
return this.httpServer.getRequestUrl(context.getArgByIndex(0));
return this.httpServer.getRequestUrl(request);
}
}

0 comments on commit e766ea7

Please sign in to comment.