Total Complexity | 7 |
Total Lines | 9 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | import { IFilterPermission } from '../../../src'; |
||
12 | |||
13 | @Injectable() |
||
14 | export class RequestAsyncFilter implements IFilterPermission { |
||
15 | |||
16 | async canAsync(params?: any[]): Promise<boolean> { |
||
17 | const name = 'test-header'; |
||
18 | // Fix: missing `headers`, using `rawHeaders` for fixing tests on Node.js 15 |
||
19 | const header = params[0]?.headers?.[name] ?? getRawHeader(name, params[0].rawHeaders); |
||
20 | return Promise.resolve(header === 'test'); |
||
21 | } |
||
23 |