Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should invoke `end` on the `response` with the `getSummary` metrics', () => {
expect(response.end).toHaveBeenCalledWith(getSummary());
});
});
module.exports = function metrics(request, response) {
if (
request.headers &&
request.headers.via &&
request.headers.via.includes('google')
) {
response.statusCode = 200;
response.end();
} else {
response.statusCode = 200;
response.setHeader('Content-Type', getContentType());
response.end(getSummary());
}
};