MCPcopy Create free account
hub / github.com/cypress-io/cypress / defaultOnRequest

Function defaultOnRequest

packages/https-proxy/test/helpers/https_server.ts:9–17  ·  view source on GitHub ↗
(req: IncomingMessage, res: ServerResponse)

Source from the content-addressed store, hash-verified

7import type { IncomingMessage, ServerResponse } from 'http'
8
9const defaultOnRequest = function (req: IncomingMessage, res: ServerResponse) {
10 console.log('HTTPS SERVER REQUEST URL:', req.url)
11 console.log('HTTPS SERVER REQUEST HEADERS:', req.headers)
12
13 res.setHeader('Content-Type', 'text/html')
14 res.writeHead(200)
15
16 res.end('<html><head></head><body>https server</body></html>')
17}
18
19let servers: https.Server<typeof IncomingMessage, typeof ServerResponse>[] = []
20

Callers

nothing calls this directly

Calls 4

logMethod · 0.65
setHeaderMethod · 0.65
writeHeadMethod · 0.65
endMethod · 0.65

Tested by

no test coverage detected