MCPcopy Create free account
hub / github.com/github/docs / fastlyBehavior

Function fastlyBehavior

middleware/fastly-behavior.js:6–14  ·  view source on GitHub ↗
(req, res, next)

Source from the content-addressed store, hash-verified

4// NOTE: This middleware is intended to be removed once testing is complete!
5//
6export default function fastlyBehavior(req, res, next) {
7 if ((req.method === 'GET' || req.method === 'HEAD') && req.get('X-CacheTest-Error')) {
8 const error = parseInt(req.get('X-CacheTest-Error'))
9 res.status(error).send(`SIMULATED ERROR ${error}`)
10 return
11 }
12
13 next()
14}

Callers

nothing calls this directly

Calls 1

nextFunction · 0.50

Tested by

no test coverage detected