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 `setHeader` with the `register` content-type', () => {
expect(response.setHeader).toHaveBeenCalledWith(
'Content-Type',
getContentType()
);
});
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());
}
};