Skip to content
Snippets Groups Projects
Commit 97158598 authored by FORESTIER Fabien's avatar FORESTIER Fabien
Browse files

Fix bug in microserviceMiddleware

parent 4119dc04
Branches
Tags
No related merge requests found
Pipeline #
...@@ -3,8 +3,8 @@ import { Logger, ForbiddenException } from '@nestjs/common'; ...@@ -3,8 +3,8 @@ import { Logger, ForbiddenException } from '@nestjs/common';
export function microserviceMiddleware(req, res, next) { export function microserviceMiddleware(req, res, next) {
Logger.log('[-] Untokenise middleware called'); Logger.log('[-] Untokenise middleware called');
if (req.headers['x-consumer-groups']) { if (req.headers['x-consumer-groups']) {
const arr = req.headers['x-consumer-groups'].split(','); let arr = req.headers['x-consumer-groups'].split(',');
arr.map(e => e.trim()); arr = arr.map(e => e.trim());
const group = arr.find(e => e === 'microservice'); const group = arr.find(e => e === 'microservice');
if (group === undefined) { if (group === undefined) {
throw new ForbiddenException('You can\'t access this ressource.'); throw new ForbiddenException('You can\'t access this ressource.');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment