(req, res, next)
| 4 | // NOTE: This middleware is intended to be removed once testing is complete! |
| 5 | // |
| 6 | export 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 | } |