(req)
| 46 | }; |
| 47 | |
| 48 | const corsFor = (req) => { |
| 49 | const origin = allowedOrigin(req.headers.origin); |
| 50 | return { |
| 51 | ...(origin ? { "access-control-allow-origin": origin } : null), |
| 52 | "access-control-allow-headers": "*", |
| 53 | "access-control-allow-methods": "GET, OPTIONS", |
| 54 | "access-control-allow-private-network": "true", |
| 55 | vary: "Origin", |
| 56 | }; |
| 57 | }; |
| 58 | |
| 59 | const json = (req, res, status, body) => { |
| 60 | res.writeHead(status, { |
no test coverage detected