Commit 97158598 authored by FORESTIER Fabien's avatar FORESTIER Fabien
Browse files

Fix bug in microserviceMiddleware

parent 4119dc04
Pipeline #2488 passed with stages
in 17 seconds
......@@ -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.');
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment