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

Fix bug in microserviceMiddleware

parent 4119dc04
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -3,8 +3,8 @@ import { Logger, ForbiddenException } from '@nestjs/common';
export function microserviceMiddleware(req, res, next) {
Logger.log('[-] Untokenise middleware called');
if (req.headers['x-consumer-groups']) {
const arr = req.headers['x-consumer-groups'].split(',');
arr.map(e => e.trim());
let arr = req.headers['x-consumer-groups'].split(',');
arr = arr.map(e => e.trim());
const group = arr.find(e => e === 'microservice');
if (group === undefined) {
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