Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if ("HttpQueryError" !== error.name)
return next(error);
if (error.headers) {
Object.keys(error.headers).forEach(header => {
res.setHeader(header, error.headers[header]);
});
}
res.statusCode = error.statusCode;
res.write(error.message);
res.end();
// request has finished - reset container
Container.reset(req);
});
};
public async beforeSuite(configAutoRelay=true) {
Container.reset();
if(configAutoRelay) {
new AutoRelayConfig(this.config);
}
if(this.runBefore) {
await this.runBefore();
}
}
}
beforeEach(() => {
getMetadataStorage().clear();
Container.reset();
});
beforeEach(() => {
Container.reset();
});
formatResponse(response: any, resolver: ResolverData) {
Container.reset(resolver.context.requestId);
return response;
},
});
afterEach(() => {
Container.reset()
})
formatResponse(response: any, resolver: ResolverData) {
Container.reset(resolver.context.requestId);
return response;
},
});