/
githubmirror
/
nest
Обзор
Документация
Войти
/
githubmirror
/
nest
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
integration/websockets/src/request.interceptor.ts
11 строк
355 B
Jay McDoniel
feat: move get pattern to top level method of switch to ws
02 фев 2023, 17:47
Не верифицирован
02 фев 2023, 17:47
edbd0a8
Код
Авторство
О чём код?
import { CallHandler, ExecutionContext, Injectable } from '@nestjs/common'; @Injectable() export class RequestInterceptor { intercept(context: ExecutionContext, next: CallHandler) { const client = context.switchToWs().getClient(); const pattern = context.switchToWs().getPattern(); client.pattern = pattern; return next.handle(); } }