MCPcopy
hub / github.com/lissy93/web-check / headersHandler

Function headersHandler

api/headers.js:5–14  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

3import { upstreamError } from './_common/upstream.js';
4
5const headersHandler = async (url) => {
6 try {
7 const response = await httpGet(url, {
8 validateStatus: (status) => status >= 200 && status < 600,
9 });
10 return response.headers;
11 } catch (error) {
12 return upstreamError(error, 'Headers fetch');
13 }
14};
15
16export const handler = middleware(headersHandler);
17export default handler;

Callers

nothing calls this directly

Calls 2

httpGetFunction · 0.90
upstreamErrorFunction · 0.90

Tested by

no test coverage detected